You are on page 1of 9

Password

Create an Action Layer


bot1.onPress = function(){

if((text1.text == "OGRE") or (text1.text == "ogre")){

textdis.text="correct";

else

textdis.text="WRONG";

bot2.onPress = function(){

if((textpass.text == "SLAY") or (textpass.text == "slay")){

_root.gotoAndStop("movieclip")

else

textpassdis.text="invalid"
}

on(release){

_root.gotoAndPlay("game level 1");

on(release){

_root.gotoAndPlay("world1");

on(release){
_root.gotoAndPlay("world4");

Game 1:Platform

onClipEvent (load) { Character Code


var ground:MovieClip = _root.ground;

var grav:Number = 0;

var gravity:Number = 2;

var maxspeed:Number = 6;

var xspeed:Number = 0;

var acceleration:Number = 2;

var maxJump:Number = -20;

var friction:Number = 0.9;

var yspeed:Number = 0;

var bounce:Number = -0.9;

var touchingGround:Boolean = false;


}

onClipEvent (enterFrame) {

xspeed *= friction;

if (Math.abs(speed) < 0.3) {

xspeed = 0;

_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)) {

if ( xspeed < maxspeed ) {

xspeed += acceleration;

_root.char.gotoAndStop(1);

if (Key.isDown(Key.LEFT)) {

if ( Math.abs(xspeed) < maxspeed ) {

xspeed -= acceleration;

_root.char.gotoAndStop(2);

if (Key.isDown(Key.UP) && touchingGround) {

grav = maxJump;
}

if (ground.hitTest(_x+(_width/2), _y-(_height/2), true)) {

acceleration = -2;

xspeed = 0;

xspeed += acceleration;

_x += xspeed ;

}else{

acceleration = 2;

if (ground.hitTest(_x-(_width/2), _y-(_height/2), true)) {

acceleration = -2;

xspeed = 0;

xspeed -= acceleration;

_x += xspeed ;

}else{

acceleration = 2;

if (ground.hitTest(_x-(_width/2), _y-(_height/2), true)) {

_x += xspeed;

if (ground.hitTest(_x, _y-(height), true)) {

grav = 3;

_x += xspeed;

}
Spike
onClipEvent(enterFrame) {

this._rotation += 3;

if(_root.char.hitTest(this)) {

_root.vcam.hp.nextFrame();

Points

onClipEvent (enterFrame) {

if (_root.char.hitTest(this)) {

_root.score += 5;

unloadMovie(this);

}
Catching Ball
Congratulation

Label

Congratulation
Project
in ICT
Jansen Ralph M. Medrano
Ict Molave
Sir. Jeph Pedrigal

You might also like