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 / My scenery doesn't move

Author
Message
KelvonUs
14
Years of Service
User Offline
Joined: 4th Sep 2010
Location:
Posted: 23rd Oct 2010 19:52
I created my first game with a model I made by myself but the proble is that the model don't move i the game.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 25th Oct 2010 00:43
Your player is made out of a plane, yet you are using mouselook to rotate it. The plane will simply twist and turn all over the place. Typically when using a plane, it is planned to move in four directions; up, down, left and right, and mouselook is probably not the best way to go. Also, you made the plane 300 X 300, which to me is one HUGE player. It is placed at 500 on the Y, yet your world model is placed a 0 on the Y. That's a big gap unless your world model is tall enough to make up the difference. Your player movement code will not help get the player at the right height.

You don't reposition the camera at all, so as your player moves, it would simply go off the screen (assuming you can see it in the first place). If you want to go with a plane, you could place the camera back on the Z axis from the player's position and point toward it.

Why not make the player a cube or sphere (or make a character model, for that matter)? If you want the player to simply move around the screen without the camera moving, set the camera back far enough that you can do that. Otherwise, code it so that the camera position is based off of the player's current x, y and z location (I'd suggest adding a little to the Y and more to the -Z) and point it at the player's position (use could use the SET CAMERA TO FOLLOW command or you could write your own routine pretty easily).

You don't have a RETURN command at the end of your Animation subroutine.

Your MovePlayer subroutine looks like you took the Sparky's example and then modified it, but you don't check for collision at all (the objects are not set up for Sparky's anyway). If your level is completely flat and you never expect to run into an obstacle, I guess this would be okay, but realistically, you're going to need some collision checking.

By using the Q button to exit, you are asking for users to get frustrated, because you are using the WASD keys for movement. One slip-up and they hit the Q key by accident and the game is lost. I would suggest picking another key for that.

I hope this is helpful to you. If you need some actual examples of code working, please post.

I'm not really a programmer.....I only play one on TGC.

Login to post a reply

Server time is: 2024-11-24 09:16:38
Your offset time is: 2024-11-24 09:16:38