GithubHelp home page GithubHelp logo

ninja-run-macromedia-flash-'s Introduction

ninja-run-macromedia-flash-

A simple game built with the help of macromedia flash only !.

I will also give the relevant codes used in the game for the character to move and all the objects , buttons , starting and ending.

the codes are not exactly used the way it is written over here there are some changes to it such as the name of object to move is the ball but in the game I have made a character and the instance name is changed to ( char ). Like this there are several other changes to the code but If a person has a basic knowledge of the macromedia flash he can easily refer to the codes here and modifiy the same to his/her purpose.

  1. char actions: registration number ( 8 )

    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. Ground Registration number ( 5 )

  3. restartBox actions: Registration number ( 2 )

    onClipEvent(enterFrame){ this._visible = false; if(_root.char.hitTest(this)){ _root.char._x =; _root.char._y =; } }

  4. vcam actions:

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

  5. The ball does not directly goes from one scene to another because gotoAndStop does not work directly and only works on button for that we still apply the same code " GoToAndStop " but with a parameter and we apply the " frame name " also and the code for that is:

    _root.goToAndStop("Frame Name");

rotation obstacle

onClipEvent(enterFrame) { this._rotation += 2; if(_root.char.hitTest(this)) { _root.vcam.hp.nextFrame(); } }

score

onClipEvent (enterFrame) { if (_root.char.hitTest(this)) { _root.score += 10; unloadMovie(this); } }

Thank you !

ninja-run-macromedia-flash-'s People

Contributors

krabhi02 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.