Script für Tasten Kombination? [Flash 7]
| Beiträge: 1 Registriert: Nov 2015
| 12.11.2015, 20:23
ich hab ein problem
nämlich kenne ich keinen script bzw. kombination
wenn ich 2 knöpfe gleichzeitig drücke das nur eine animation
abgespielt wird könnt ihr mir bei diesen problem helfen?
Mfg
FutureGamer
ActionScript:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 13;
var maxJump:Number = -30;
var touchingGround:Boolean = false;
scale = _xscale;
}
onClipEvent (enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
}
if (ground.hitTest(_x, _y + 5, true))
{
jumping = false;
touchingGround = true;
}
else
{
jumping = true;
touchingGround = false;
}
if (Key.isDown(Key.RIGHT))
{
_xscale = +scale;
_x += speed;
if (!jumping)
{
this.gotoAndStop(2);
}
}
if (Key.isDown(Key.LEFT))
{
_xscale = -scale;
_x -= speed;
if (!jumping)
{
this.gotoAndStop(2);
}
}
if (Key.isDown(Key.UP) && touchingGround)
{
grav = maxJump;
jumping = true;
this.gotoAndStop(3);
}
if (Key.isDown(Key.DOWN)){
this.gotoAndStop(4);
}
if (Key.isDown(70)){
this.gotoAndStop(5);
}
if (ground.hitTest(_x+(_width/2), _y-(_height/2), true)) {
_x -= speed;
}
if (ground.hitTest(_x-(_width/2), _y-(_height/2), true)) {
_x += speed;
}
if (ground.hitTest(_x, _y-(height), true)) {
grav = 3;
}
}
onClipEvent (keyUp) {
this.gotoAndStop(1);
}
|
ps. ich benutze Cs6 | |
| Ähnliche Beiträge zum Thema | 23.10.2020 - Skynetzx |
|
Flashhilfe.de Flash Platform Tipps & Tutorials Flash Platform Andere Programmiersprachen Jobangebote Diskussionen
Flashhilfe News 
Regeln & Bedingungen
|