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 / Sprite Movement And Control Help

Author
Message
blank
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location: My Computer
Posted: 8th Nov 2003 19:23
Hey all, after a long time away, im back, i may change my name soon but anyway back to the question. How can i make a sprite change its facing direction when i press a direction key. For example asy a pressed up, the image would face upwards on the screen and move in that direction, and if i press say left it would do the same only leftwards on the screen. Thanks.
Cartoon Monkey
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Nov 2003 23:18
Whenever you change horizontal direction just call the MIRROR SPRITE command for that sprite, and for vertical, use FLIP SPRITE
blank
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location: My Computer
Posted: 9th Nov 2003 01:10
ok, ill try that, thanks a lot.
blank
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location: My Computer
Posted: 9th Nov 2003 23:29
I tried that and it worked, but how do i do that so that it only changes once instead of continuously
Thanks
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Nov 2003 01:00
Just record which direction you are facing in a variable and if it's not correct when you move, mirror the sprite

Here's some example code for you to build on

blank
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location: My Computer
Posted: 10th Nov 2003 15:34 Edited at: 10th Nov 2003 15:35
ok, thanks for your help. Youll be in the credits for my game under special thanks, when its finished that is. Should i put your forum name, or do you want you full name? if so post your email and full name, thanks alot again, good luck in the future. Speak to you soon. Cartoon Monkey
blank
21
Years of Service
User Offline
Joined: 4th Mar 2003
Location: My Computer
Posted: 10th Nov 2003 17:58
o, sorry to bother you all again,but i tried out that code in db classic and it worked fine, though when i tired it out in dbpro, and it flipr the image fine but didnt move so i put the sprite 1,x,y,1 command after the control bit and the sprite moved but didnt flip or miror. i supplied my code, please help. Thanks. Cartoon Monkey

Login to post a reply

Server time is: 2024-11-25 16:34:41
Your offset time is: 2024-11-25 16:34:41