00:00
00:00
View Profile PlayMyFlash8games

Male

Joined on 6/24/11

Level:
5
Exp Points:
195 / 280
Exp Rank:
221,718
Vote Power:
4.16 votes
Rank:
Civilian
Global Rank:
99,933
Blams:
2
Saves:
45
B/P Bonus:
0%
Whistle:
Normal

Latest News

More

Hello, here you can post all your actionscript 2.0 codes for flash to make nice games and animations!
Post yours:
1. Code for char right, left and up:
onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 7;
var maxJump:Number = -12;
var touchingGround:Boolean = false;
}
onClipEvent (enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
}
if (ground.hitTest(_x, _y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.UP) && touchingGround) {
grav = maxJump;
}
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;
}
}

2. Vcam Code:

onClipEvent (enterFrame) {
_y += (_root.char._y-_y)/4;
_x += (_root.char._x-_x)/4;
}


Recent Game Medals

10 Points

Latest Playlists

PlayMyFlash8games doesn't have any playlists, and should go check out some amazing content on the site and start adding some!