Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Problem with Placing Sprite

Author
Message
DumbNewbee
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location: United States
Posted: 17th Jul 2003 18:09
Hi Im Having Problem Placeing a sprite onto my Game The Code for the game is short so ill paste it here


Ok well that was about it, Im just making a small space shooter style game and i just need my ship to apear on screen. Anything will be helpfull thanks
Are all newbees dumb? or illiderat
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 17th Jul 2003 18:47
Try something like:



Your first problem was, you loaded a bitmap, not an image and the SPRITE command uses images. Also, as you are using the SYNC ON command, you need to do a manual sync to update the screen, which you didnt do, so effectively your program crashes. Thats why I added a quick DO loop, so sync is called every cycle.

Cheers,
Kentaree

Whatever I did I didn't do it!
DumbNewbee
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location: United States
Posted: 17th Jul 2003 19:01
Thanks!

Are all newbees dumb? or illiderat
DumbNewbee
21
Years of Service
User Offline
Joined: 16th Jul 2003
Location: United States
Posted: 17th Jul 2003 19:15
Ok Im having another Problem On getting it to work, I got it to show up but I still want it to move This is what i added...
[/code]CLS
hide mouse
sync on
sync rate 25
load image "Herofighter.bmp",1
sprite 1,260,400,1
speed = 2
do
sync
if upkey() then ypos = ypos - 1
if downkey() then ypos = ypos + 1
if leftkey() then xpos = xpos + 1
if rightkey() then xpos = xpos - 1
loop[code]

Are all newbees dumb? or illiderat
iammesol
21
Years of Service
User Offline
Joined: 8th Jul 2003
Location:
Posted: 18th Jul 2003 23:58
i had this prob a few days ago !!! u have to do this b4 u can say xPos-1



hope i helped

Login to post a reply

Server time is: 2024-11-24 23:04:56
Your offset time is: 2024-11-24 23:04:56