# !URGENT! Driving Game Like Art Based RPG !URGENT!

**URL:** <https://forum.kirupa.com/t/urgent-driving-game-like-art-based-rpg-urgent/34005>\
**Category:** Uncategorized\
**Created:** [October 26, 2003, 8:42pm UTC](https://forum.kirupa.com/t/urgent-driving-game-like-art-based-rpg-urgent/34005 "2003-10-26T20:42:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ALPHA](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@ALPHA](https://forum.kirupa.com/u/ALPHA)\
**Post date:** [October 26, 2003, 8:42pm UTC](https://forum.kirupa.com/t/urgent-driving-game-like-art-based-rpg-urgent/34005/1 "2003-10-26T20:42:20Z")

</div>

I am making a small game with a drivable vehicle the view is from above and I’ve made it with a tile based method, like Zelda. What I need to do is turn it into a game where you can drive around and the background moves with the vehicle like an art based rpg.

I’ve got the code for the vehicle and accurate hit tests and consequences all I need is the code to work.

Theres an art based rpg here: [http://www.gotoandplay.it/\_articles/2003/10/zelda.php?PHPSESSID=ea898fd9dd533727da60632455fff19f](http://www.gotoandplay.it/_articles/2003/10/zelda.php?PHPSESSID=ea898fd9dd533727da60632455fff19f) but I don’t know which code where should go where in my game from the example.

The art based source file is here: [http://www.gotoandplay.it/\_articles/2003/10/\_zelda/OS\_zelda\_v1.3.zip](http://www.gotoandplay.it/_articles/2003/10/_zelda/OS_zelda_v1.3.zip)

The code for the vehicle for convenience:  
[AS]onClipEvent (enterFrame) {  
// make the car go forward  
if (Key.isDown(Key.UP)) {  
speed += 1;  
}  
// make the car go backwards  
if (Key.isDown(Key.DOWN)) {  
speed -= 1;  
}  
// tells the car to slow down after the speed of 20  
if (Math.abs(speed)\>20) {  
speed \*= .7;  
}  
// you can change the rotation of the car to your desire  
if (Key.isDown(Key.LEFT)) {  
\_rotation -= 15;  
}  
if (Key.isDown(Key.RIGHT)) {  
\_rotation += 15;  
}  
// here is where the hittest is for the boundary  
speed _= .98;  
x = Math.sin(\_rotation_(Math.PI/180))_speed;  
y = Math.cos(\_rotation_(Math.PI/180))_speed_-1;  
if (!\_root.land.hitTest(\_x+x, \_y+y, true)) {  
\_x += x;  
\_y += y;  
} else {  
speed \*= -.6;  
}  
}[/AS]
