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.

2D All the way! / moving a sprite

Author
Message
pokerman
14
Years of Service
User Offline
Joined: 20th May 2009
Location: Bournemouth, England
Posted: 21st May 2009 11:13
I am just starting with dark GDK and i am making a sidescrolling shooter i have managed to make the ship move up and down but i am wondering how i input the controls so that i can go forward and back and so that it stops at the edge of the screen.

Any help will be greatfully recieved

thanks joe
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 22nd May 2009 17:09
For moving left to right you would just need to change the X of the sprite. course there is a "Move Sprite" command i think but that depends on orientation i think doesn't it?

Either way just use a if statement to make sure it's in the screen and then check if you input key is pressed then increase(or decrease) the X variable you have set in place

New Site! Check it out \/
pokerman
14
Years of Service
User Offline
Joined: 20th May 2009
Location: Bournemouth, England
Posted: 9th Jun 2009 16:56
sorry for taking so long in getting back that works thank you

Login to post a reply

Server time is: 2024-04-24 08:41:53
Your offset time is: 2024-04-24 08:41:53