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 / How to Program Sprites

Author
Message
Gatorules
15
Years of Service
User Offline
Joined: 17th Dec 2008
Location:
Posted: 18th Dec 2008 01:57
I am very new to this type of programming and am trying to add a section to my code that will change the direction that an image goes in. I have tried to change the XValue and Rotate the object but I can't find and functions that will do the job. If you know the function that I am looking for please help me.
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 18th Dec 2008 05:29
Those commands should work. Are you using paste image to update the sprite location, or are you using move sprite?

please post the code and we will be able to help.

Tom0001
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location:
Posted: 9th Jan 2009 22:45
Gatorules, there are a few ways you can do this. One would be to use the PASTE IMAGE command and have it paste the sprite image at a variable for the x value and a variable for the y value, then detect if the player is pressing an arrow key and, if so, then increase or decrease the x and y values accordingly. This way, the image will be pasted at the location you are specifying and can be controlled with the arrow keys.

Another method would be to use the same sort of code, but instead of PASTE IMAGE, you would use the SPRITE command. You could also use MOVE SPRITE.

Tom

Login to post a reply

Server time is: 2024-09-28 00:21:21
Your offset time is: 2024-09-28 00:21:21