00:00
00:00
Newgrounds Background Image Theme

sound-sakura just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Platformer Help

Share Collapse

Author Comments

PLEASE READ! EXTREMELY IMPORTANT!!!!!
THIS ISN'T THE REAL GAME!!!!


Arrow Keys to Move! Space to Jump


This Isn't the real Game!


I have a problem with my platformer. When my character Dies And His Death Movie Clip Shows Up, it is still possible to make him move and jump and all that. How Do I immobilize him while he is supposed to be dead?


Here Is The Actionscript :


-------------------------
---------------
-------------------------
---------------
-------------------------
------


onClipEvent (load) {
var grav:Number = 0;
// gravity
var speed:Number = 10;
// how fast you walk
var jumpHeight:Number = 9;
// how high you jump
var slow:Number = .7;
// sets water falling speed
var slowspd:Number = speed/1.5;
// sets water walking speed
var setspeed:Number = speed;
var scale:Number = _xscale;
var ex:Number = 5;
// makes hitTests better, change for a closer hitTest (warning, more buggy if smalle, less real if further)
this.gotoAndStop(2);
}
onClipEvent (enterFrame) {
grav++;
_y += grav;
while (_root.ground.hitTest(_x, _y, true)) {
_y--;
grav = 0;
}
if (_root.water.hitTest(_x, _y, true)) {
if (grav>0) {
grav *= slow;
}
speed = slowspd;
} else {
speed = setspeed;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
_xscale = scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else if (Key.isDown(Key.LEFT)) {
_x -= speed;
_xscale = -scale;
if (_root.ground.hitTest(_x, _y+3, true)) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else {
if (_root.ground.hitTest(_x, _y+3, true) && !Key.isDown(1) && !Key.isDown(1)) {
this.gotoAndStop(3);
}
}
if (Key.isDown(Key.SPACE) && _root.ground.hitTest(_x, _y+3, true)) {
grav = -jumpHeight;
_y -= 4;
this.gotoAndStop(2);
}
if (_root.ground.hitTest(_x+
(_width/2)+ex, _y-(_height/2), true) || _root.ground.hitTest(_x+(
_width/2)+ex, _y-(_height/6), true) || _root.ground.hitTest(_x+(
_width/2)+ex, _y-_height, true)) {
_x -= speed;
}
if (_root.ground.hitTest(_x-
(_width/2)-ex, _y-(_height/2), true) || _root.ground.hitTest(_x-(
_width/2)-ex, _y-(_height/6), true) || _root.ground.hitTest(_x-(
_width/2)-ex, _y-_height, true)) {
_x += speed;
}
if (_root.ground.hitTest(_x, _y-_height-15, true)) {
grav = 1;
}
}
onClipEvent (enterFrame) {
if (_root.Fell.hitTest(_x, _y+3, true)) {
this.gotoAndStop(5);
}
}
onClipEvent (enterFrame) {
if (_root.spike.hitTest(_x, _y+3, true)) {
this.gotoAndStop(10);
}
}


-------------------------
---------------
-------------------------
---------------
-------------------------
-------------


"Fell" is a death MC when he falls where he shouldn't


"Spike" is another death MC when he falls in a spike pit.


Any Help Will Be Much Appreciated!


P.S. I also would like to know how i can make my character climb across things. As For Example Make Him Shimmy Across a rope, when he can't walk on the ground.


You'll realize this when you play!


So plz don't blam this, I need this to pass so i can read the helpfull reviews if there are any.

Log in / sign up to vote & review!

This is an uncompleted demo. Next time submit a finished game.

what's the name for the character movie clip?

Fun!!

awesome game!!

you have 2 ways

you can load the death animation as new movie clip with the coordinates of your died player
or
you can make a isAlive var, only if this is true the controls work

thats how I would make it

Damn

sorry i have no idea how to make games
but i know how to use actionscript with movies and stuff if you need any help with that
any way i like what you've done so far keep it up ;D

Credits & Info

Views
5,182
Faves:
5
Votes
9
Score
3.68 / 5.00

Uploaded
Aug 22, 2009
2:19 AM EDT