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.

Dark GDK / Moving objects (noob)

Author
Message
Shrooster
13
Years of Service
User Offline
Joined: 29th Mar 2011
Location:
Posted: 29th Mar 2011 21:07
Hi, I just started learning programming so dont judge me I tried to look this up here and google couldnt not find any credible source that I can use to:

What I need basically I have a little man that moves around the screen keyboard controlled and I have a box that needs to be moved to certain location. I could not get that little guy to move box i used command:
dbMoveSprite but the box just move North towards the upper bit of the screen. What I need that little guy to be able to move the box to the right if he pushes it from the right side and vice versa. I think I need to use switch function for this but I am not sure.

Any advice would be of great help!

Thanks in advance!

Shrooster
13
Years of Service
User Offline
Joined: 29th Mar 2011
Location:
Posted: 30th Mar 2011 00:58
I forgot to mention that its 2D layout, birds eye view.
Shrooster
13
Years of Service
User Offline
Joined: 29th Mar 2011
Location:
Posted: 30th Mar 2011 13:53


The code I used so far
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Mar 2011 16:08 Edited at: 30th Mar 2011 16:10
You probably want to match the box angle to the player angle, then they will move in the same direction.

Thats probably the easiest way to do it, there are better ways which are a little more complex.

EDIT: I am presuming that you control your man by changing his angle, if not then this will not work at all.

Login to post a reply

Server time is: 2024-06-15 22:11:25
Your offset time is: 2024-06-15 22:11:25