paint program, need help - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: paint program, need help (/thread-8495.html) |
paint program, need help - axipher - 12-04-2005 A game Iâm working on right now uses 16x16 sprites, so instead of designing all of the sprites myself, Iâve decided to add a sprite editing part so you can make your own, and now I come asking for help, here is the code Iâm using, Iâll put it into the main program later or Iâll make a stand alone sprite editor and use the same loading system that this will use in the main program to load the sprite, I just need this painting part to work, I put quite a few comments to help Here is a link to my code, since it won't let me paste my code: http://fbtext.piczo.com/?cr=3&rfm=y Now my problems are the following: -> How to use the BSAVE and BLOAD -> If there would be a way to save the picture you make as a file so this program could be a stand alone and then how to load it in my game which is also screen 13,,,1 -> A way to draw a line through user input -> A way to draw a circle through user input without going out of the drawing area box Any help possible is much appreciated Also, I need your opinion on my splash screen, it's not much, but so far thereâs 3 possibilities: Just give your honest opinion on each one and suggest improvements on your favorite. paint program, need help - Z!re - 12-04-2005 Big fucking signature of ugly crap! It's covering my entire screen! No, it's crushing me! Get it off get it off! paint program, need help - stylin - 12-04-2005 you're falling through your subroutines. You're returning only under the condition of IF statements - ie., under certain conditions, such as the state of user input (which, by the way you only check once at the beginning of the program), you return if met, and keep right on executing if not met. My recommendations: * Use actual SUBs and FUNCTIONs instead of subroutines. It eliminates pesky errors like this * Check user input every iteration of your main loop, and call your SUBs/FUNCTIONs based on that input - ie., right now you're calling every one of those subroutines regardless of whether the user wants to save/load, change color, etc. @Z!re : damn woman, your post is polluting my screen. There is a pm feature on these forums, you know. You might want to use it (sorry, too lazy to use it myself. Do as I say, not as I do). Besides, there's no need to crap on the OP when he's asking for help. Not very nice. paint program, need help - Agamemnus - 12-04-2005 This is a good new program, and you have learned much, but... 1) Ok, again, I told you this before..... but, you need to know what your program is doing. When you're doing "SAVE", you need to do a RETURN after it, like this: "SAVE: RETURN". Better yet, just put the RETURN at the end and don't put it after each IF statement.. if the answer is not Y or N, it will just end the program. You are not guaranteed to get a Y or N with an INPUT statement. And, don't forget a SYSTEM or END at the END of your DO...LOOP. 2) You don't have an I$ = INKEY$ in your loop! 3) Your X and Y limits are all wrong. They are all set to 51.. I can tell you didn't really finish that part, though. 4) I have no clue why, but in FB, CHR$(0) is replaced by CHR$(255)?? 5) To save and load you can do many different things, including BLOAD and BSAVE, and using a sub from somewhere else to load/save in gifs, bmp's, jpg's, etc, or you can make your own routine..: You should have a 2 dimensional array that records the color of each coordinate.. whenever you draw something in your screen, draw something to your array in that color, too. (Assign the value to the correct coordinate) 6) You can always use PAINT, you know.. paint program, need help - axipher - 12-05-2005 i said i dont care about the actual box itself, i changed how it works and it works fine, its just the loop, i played around with it how i think i should but nothing, the box that is drawn in is now rite near the top left, ill change it so theres a zoomed in painting area later, but for, its just the damned loop, and saving in bmp form is alrite by me, later ill add a choice system to it where it adds the extension to the filemame, im only asking for help coding the loop and saving, loading, exiting, thats all, but if u wanna help wit the choices for the saving, then thats fine, ull get credit paint program, need help - Agamemnus - 12-05-2005 I did... paint program, need help - axipher - 12-05-2005 well i tried using an if then before each gosub but no luck, im goin to try making each SUB a loop instead of just the main loop paint program, need help - Z!re - 12-05-2005 Quote:@Z!re : damn woman, your post is polluting my screen. There is a pm feature on these forums, you know. You might want to use it (sorry, too lazy to use it myself. Do as I say, not as I do). Besides, there's no need to crap on the OP when he's asking for help. Not very nice.Poop paint program, need help - Agamemnus - 12-05-2005 Just try this..... Code: DEFINT A-Z paint program, need help - axipher - 12-05-2005 this is really starting to get complicated, i had a simple idea, and now its complicated, but i wont give up, i want to do this, i must complete this project, i must avenge... maybe thats a little too far |