prosp3ct
12-06-2007, 06:47 AM
hi I'm new to actionscript technically but i'm trying make a game (which is development as I Speak) and i just need to know how to combine Key.[action] because I'm working on a COMBO system as well as a SPECIAL move system but i can't figure out if I'm writing it wrong or just messing it up some how.
i'll give you an example of my code
its basic until i finish up a few things
example:
onClipEvent (keyDown) {
//var for bind
db = Key.ENTER && Key.PGUP;
if (Key.getCode() == Key.RIGHT) {
this._x += 5;
} else if (Key.getCode() == Key.LEFT) {
this._x += -5;
} else if (Key.getCode() == Key.UP) {
this._y += -5;
} else if (Key.getCode() == Key.DOWN) {
this._y += 5;
}
//double bind config v 1.0//
else if (Key.getCode() == db)
{
// special
}
}
and please tell me if I'm in the wrong thread because I'm not sure if this is AS 1.0 or 2.0 *gulp* *light laughter* please get back to me ASAP PLEASE I'm making this game for my little cousins
i'll give you an example of my code
its basic until i finish up a few things
example:
onClipEvent (keyDown) {
//var for bind
db = Key.ENTER && Key.PGUP;
if (Key.getCode() == Key.RIGHT) {
this._x += 5;
} else if (Key.getCode() == Key.LEFT) {
this._x += -5;
} else if (Key.getCode() == Key.UP) {
this._y += -5;
} else if (Key.getCode() == Key.DOWN) {
this._y += 5;
}
//double bind config v 1.0//
else if (Key.getCode() == db)
{
// special
}
}
and please tell me if I'm in the wrong thread because I'm not sure if this is AS 1.0 or 2.0 *gulp* *light laughter* please get back to me ASAP PLEASE I'm making this game for my little cousins