From Normandy to Nagasaki
From Normandy to Nagasaki
I'm making a game with my friend..
It's based on the game Warlords: Call to arms.
I'm the scripter, he's the artist..
AD for FNTN
The AS2 battle system has a lot of glitches I tried to fix..
AS2 battle system
But I cannot fix it.. So I switched over to AS3..
Which is more helpful, and it makes me feel more powerful.. Declaring all the functions, variables, and all sorts of whacky stuff..
I got the Arrow down in AS3..
And I'm working on the spawn buttons..
MY AS3 BATTLE SYSTEM (BETA 0.1)
He's the AS3 code for the Arrow for showing off
It's based on the game Warlords: Call to arms.
I'm the scripter, he's the artist..
AD for FNTN
The AS2 battle system has a lot of glitches I tried to fix..
AS2 battle system
But I cannot fix it.. So I switched over to AS3..
Which is more helpful, and it makes me feel more powerful.. Declaring all the functions, variables, and all sorts of whacky stuff..
I got the Arrow down in AS3..
And I'm working on the spawn buttons..
MY AS3 BATTLE SYSTEM (BETA 0.1)
He's the AS3 code for the Arrow for showing off
- Code:
//Begin Events
stage.addEventListener(Event.ENTER_FRAME, aEvent);
stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKeys);
stage.addEventListener(KeyboardEvent.KEY_UP, checkKeyUp);
//End Events
//Begin Imports
import flash.ui.Keyboard;
//End Imports
//Begin Variables
var wentup:Boolean = false;
var wentdown:Boolean = false;
//End Variables
//Begin Scripts
function checkKeys(event:KeyboardEvent) {
if ((!wentup) && event.keyCode == 38) {
Arrow.y-=44;
wentup = true;
}
if ((!wentdown) && event.keyCode == 40) {
Arrow.y+=44;
wentdown = true;
}
}
function checkKeyUp(event:KeyboardEvent) {
if (event.keyCode == 38) {
event.keyCode = 0;
wentup = false;
}
if (event.keyCode == 40) {
event.keyCode = 0;
wentdown = false;
}
}
function aEvent(event:Event) {
if (Arrow.y<=160) {
Arrow.y = 160;
}
if (Arrow.y>=378) {
Arrow.y = 378;
}
}
//End Scripts
Fighterlegend- Member
- Posts : 12
Join date : 2009-06-22
Permissions in this forum:
You cannot reply to topics in this forum