Page 1 of 1
game question
Posted: Wed Feb 09, 2005 8:54 pm
by Blorg
Hi im super stumped on this problem. How can I upload a picture that I drew in paint to qb. All my classmates recomend doing pset to draw the picture, but since I'm not too crazy about typing for 30min a stupid pset code I'm hoping someone will help me out.
game question
Posted: Wed Feb 09, 2005 9:17 pm
by Blorg
Just wanted to post the code that i did so far. I dont know if its right or if it works for that matter. When i ran it it made no error so im guessing its ok. If it does work i need to know how to get it to the screen, if it dosnt can someone plz show me how to fix it.
CLS
SCREEN 12
OPTION BASE 1
CONST file$ = "c:\pic.bmp"
port = 1
OPEN file$ FOR INPUT AS #port
WHILE NOT EOF(port)
INPUT #port, num
count = count + 1
WEND
DIM pic(1 TO count, 1 TO count)
CLOSE port
OPEN file$ FOR INPUT AS #port
FOR x = 1 TO count
FOR y = 1 TO count
INPUT #port, num
pic(x, y) = num
NEXT y
NEXT x
END
Thx In Advance (oh and srry the indentations didnt work so it might look messy)
Posted: Thu Feb 10, 2005 9:56 pm
by Ralph
Just to let you know that, when posting or replying, there is a list at the top, which inlcudes Code. If you press Code and then enter your code, ending with pressing the *Code button, you will get your code very nicely displayed. Try it, next time you want to show your code.
Posted: Fri Feb 11, 2005 1:25 am
by Dr_Davenstein
Well, if it's a windows bitmap file that you're loading, that wont work because the .bmp format is a little more complicated. If you wanna get started making games very easily in QB, you should try one of the libraries. Here's a link to Piptol's site. He has the
best of the best of QB libraries.
http://piptol.qbasicnews.com/
I would reccomend that you try DirectQB first. It's the easiest to use and extremely well documented. You can do things like instantly load bitmaps, rotate sprites, check for sprite collisions, check for multiple Keys, all pressed at the same time, use offscreen buffers, etc... I can help you set up QB for running it, if you want. Just post here again if you have trouble.
Posted: Sun Mar 20, 2005 10:04 pm
by Guest
you can also create a sequential file of data with the picture (ie the colours)
lets say its a blue arrow (what i had in my game)
001111100
001111100
001111100
001111100
011111110
001111100
000111000
000010000
after you have that (its easier if you do grid view in paint) and then you just press enter until its all one set and then you can read it as a sequential file, pop it into an array, and use GET/PUT to put it wherever you want...