Hi
I am doing an assignment and I have to make a car drive around a race track. I want you to be able to control the car with the keyboard. I have this code:
onClipEvent(enterFrame) {
speed = 10;
if (key.isdown(key.UP)) {
_y-= speed;
}
if (key.isdown(key.DOWN)) {
_y+= speed;
}
if (key.isdown(key.LEFT)) {
_x-= speed;
}
if (key.isdown(key.RIGHT)) {
_x+= speed;
}
}
But my car doesn't turn. It like slides and it stays the same way. I need a script that i can type in that will enable me to make the car move properly and change direction.
PLEASE HELP ME!
Last edited by funky_sponge; 10-03-2003 at 09:12 AM.
hey there,you shouldn´t just change _x of the car when pressing left or right,instead you should chnage the rotation ( _rotation )
also press the search button and have a look for threads having to do with car motion,there are plenty of sources/threads on the board
Originally posted by enceenoman pelle I thank you, finally that code is out and being used.
rocket science for script kiddies
you can find the original in the
post your code snippets for mx 2004
thread
looks like youll have to, the code above doesnt work lol
I don't get what you mean 'encee'. I know that the code doesn;t work but i don't get where to go to get the code? Could you please give me a link to the page or a code to help me. I would appreciate it if you could help me!
Thanks
Yeah, the code does work fine. I have another question, when I run it and start driving around the image doesnt look really smooth. How do I fix that? Heres the fla.
If your fla is accurate, you're running the movie at 12 fps, if you want to make it faster just increase your fps, I'd say to about 25 ish. Nice Harvest Moon sprite btw