|
-
Senior Member
[Game Dev] Land Raider
This is a thread for my tank game called land raider.... It would be nice if yhe poeple here at FK would be able to help me in any delemers and point me in the right direction.
My game is a side scroller and my tank has a rotatable turret, but i cant seem to get it to stop after rotationg 180 degree's here is my code can some one tell me what i am doing wrong or a place that has somthing like this.
Code:
onClipEvent (load) {
weopon.gotoAndStop(1);
gotoAndStop(1);
acceleration = 0;
zero = 0;
gravity = 2;
speed = 10;
rotation = 5;
maxrotation = 180;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
weopon._rotation = rotation++;
} else {
if (weopon._rotation>maxrotation) {
weopon._rotation = rotation--;
}
}
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Official Shoe Shiner
something like this?
code:
if ((Key.isDown(Key.UP)) && ((weopon._rotation<maxrotation))) {
weopon._rotation = rotation++;
} else if ((Key.isDown(Key.DOWN)) && (weopon._rotation>0)) {
weopon._rotation = rotation--;
}
(weapon is spelt weapon, not weopon )
Message on a gravestone: I finished before you in the human race.
Using: Flash MX
-
Senior Member
kewl thanks,
i changed my code a little because it wasnt running smooth. here is the new one and it works like a charm so if any one needs it in the future here it is.
Code:
onClipEvent (enterFrame) {
if ((Key.isDown(Key.UP)) && ((weopon._rotation<180))) {
weopon._rotation += 5;
} else if ((Key.isDown(Key.DOWN)) && (weopon._rotation>0)) {
weopon._rotation -= 5;
}
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
I need a tutorial on how to make my tank rotate with the ground Eg: if the ground is at a 45 degree angle i want my tank to be at 45degree's to....
dose any one know of a good tutorial for this??? or any ideas on how it could be done.
I saw this kewl game on some site of a monster truck and u had to get threw the level without tipping over....the ground was all hilly and there was some kewl gravity codes in place. it was realy kewl.
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Official Shoe Shiner
erm, tank._rotation=ground._rotation ?
Message on a gravestone: I finished before you in the human race.
Using: Flash MX
-
Senior Member
i dont understand....
think of it like this.... there is a hill it gose up and then down.... when my tank begins to go up my tank rotates with the angle of the ground.
I belive there is going to be some fair crucial maths needed... if it were simpler i would just ask for peepz help....
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
here is a game called funky truck, can any one tell me how i would make my tank rotate to the angle of the ground...
http://www.teagames.com/games/funkytruck/play.php
I would realy apreciate if you new of a tutorial or something
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
-
Senior Member
BlinkOk has provided very nice example in this thread:
http://www.flashkit.com/board/showthread.php?t=646378
-
Senior Member
kewl... i checked out your tutorial on vectort as well... its all way to confusing and i cant thing of a way to do what i want simpler... If you know of a way tell me.... i dont care if its a bit dodgy im only new and only trying to learn...
but any ways, my game will just have to go wihtout
92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|