|
Post by zargontapel on Jun 26, 2009 22:08:28 GMT -5
Well, I was screwing around with trying to use the mouse to control the position of the sprite.. I got it to work, but it is quite laggy. Maybe it's just my computer( I use Vista 32bit), but if anyone can show how to make it run faster, any help would be greatly appreciated. Here's my code so far:
Dim MouseX#, MouseY#, ship
ship = newsprite(loadtex("data/f117.png")) sprsetpos(320, 240)
While TRUE MouseX# = Mouse_X() * 640 MouseY# = Mouse_Y() * 480 sprsetx(MouseX#) sprsety(MouseY#) AnimateSprites() cls Wend
Any suggestions?
|
|
|
Post by Darkjester on Jun 27, 2009 0:24:07 GMT -5
dim spr = newsprite(true) bindsprite(spr) sprsetcolor(1,0,1)
while true sprsetx(mouse_x()*windowwidth()) sprsety(mouse_y()*windowheight()) wend
Try that, if you still get lag, then might be your computer, i noticed on your program you used 640,480, use windowwidth() and windowheight() to return the window size for you that way you can change resolution without problem -darkjester
|
|
|
Post by zargontapel on Jun 27, 2009 7:03:59 GMT -5
Ok, thanks. That's much better. I'm thinking of making some kind of 2d shoot'em up, with using this sprite to click special upgrades and weapons....or something. Thanks for the help!
|
|
|
Post by Darkjester on Jun 27, 2009 8:24:44 GMT -5
Ok, thanks. That's much better. I'm thinking of making some kind of 2d shoot'em up, with using this sprite to click special upgrades and weapons....or something. Thanks for the help! Goodluck ;D its quite fun to make one of those, im working on one myself using opengl as opposed to the sprite engine. -dakrjester
|
|