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! / Sprite Movement

Author
Message
NickHudson
15
Years of Service
User Offline
Joined: 19th Mar 2009
Location:
Posted: 19th Mar 2009 18:00
Hi all, Im pretty new to DB but have good experience in C++ and VisualBasic.

My major task is "Modelling Human Behaviour using Computer Gaming Software", however, in the early stages of my project I simply want a sprite to move from one door, through a room, to another door, after a key press. Its 2D and we are looking at the room from the top down...

OK - so my code is going ok-ish! I have the walls built, when I have the sprite positioned as an image, I can have it stood in the first doorway, but cant get it to respond to a key press....or when i have it as a sprite, its never where i want it, but i can make it move!!

its very frustrating, and have used as many examples/tutorials off the forum for help and guidance, but have decided just to throw the question out there for help now!

This code has only the bottom left corner of the walls visible, and when the rightkey is pressed, the sprite does move, but its nowhere near where it should be...



Is there anything obvious that I'm doing wrong? Any help is very much appreciated.

Nick Hudson
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 20th Mar 2009 02:55
Is using a 2D sprite with 3D walls what you intended to do? The position coordinates for 2D sprites and images follow a very different pattern than 3D world coordinates do. Try making your player/human a 3D object.



NickHudson
15
Years of Service
User Offline
Joined: 19th Mar 2009
Location:
Posted: 21st Mar 2009 18:34
Hi,
thanks for your answer.

But no, I am supposed to be looking "top down" onto a room, therefore I am trying to use 2d.

Could you help me out with the best thing to do? I am tryin to model human movement through a room, so the walls have to be fixed and the sprite/object should move through it, and not through the walls.

Nick

Login to post a reply

Server time is: 2024-04-19 21:21:33
Your offset time is: 2024-04-19 21:21:33