Archive for the ‘ActionScript3 as3’ Category
ActionScript: Protect your Flash games on the web, sitelock all your games.
If you want to submit your games on one game portals DO NOT UPLOAD YOUR GAMES WITHOUT A SITELOCK SCRIPT. WHY ? Your games can be “stolen” by game portals. Or if you didn’t finish your game it’s a really a “pain in the ass” to update your games spread on all the web. I [...]
In: ActionScript3 as3, Tip · Tagged with: domain, flash, game, lock, protection, site, sitelock
ActionScript: Good practices in Flash developement
Here some tips and a list of good practices in Flash developement. These tips are usefull for coders and designers. Prepare your layers When you create a new .fla file prepare your layers like this : Add a new layers “Actions” on the top of the list. This layer will be dedicated to ActionScript. Then [...]
In: ActionScript3 as3, Tip
ActionScript: Tutorial How to create a gravity like a Mario platformer
In this little tutorial you will learn how to create a gravity like a Mario platformer. Let’s start! Get files Save these 2 sprites (Right click > Save as) Open Flash and create a new ActionScript 3.0 document. Document properties: 24 fps, 550×400 by default. Create the Hero MovieClip Create a new Symbol: Insert > [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: acceleration, as3, bounce, gravity, jump, mario, physic, plateformer, sonic
ActionScript: Move an object with keyboard with absolute controls
In this tip I will show you how to move an object with keyboard with absolute controls. See also how to move an object with keyboard relative-camera control. What is the absolute controls? The direction of your object will be calculated depending the object orientation. (Biohazard, Micro Machines, Gears of War). This code is very [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: absolute, actionscrip, car, controls, flash, game, Tutorial
ActionScript: Move an object with keyboard with camera relative control
In this tip I will show you how to move an object with keyboard with camera relative control. What is a camera relative control? The direction of your object will be calculated depending the camera position. (Mario 64, Uncharted, GTA 3, etc.). Eg: If press the right button the character will go on the right. [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: ActionScript3 as3, arrows, camera, key, keyboard, move, relative
ActionScript: Move an object to coordinates with smoothing
There is a simple formula to move an object to coordinates with smoothing. The speed will decrease with smooth during the time. speed = distance_between_objects / smoothing The distance will decrease because the distance will decrease too. If I set values I got: object.x = 50 targetX = 100 speedX = (targetX – object.x) / [...]
In: Game Design, Tip, Tutorial · Tagged with: 3, ActionScript3 as3, move, object, smooth
ActionScript: Launch a function after a delay with setTimeout
There are different ways to launch a function after a delay: With the enter frame event; With the Timer class; With a motion tween; With the enter frame event and the getTimer() method; And with the setTimeout function (See setTimeout help on Adobe); How to master the setTimeout ? First of all you must create a [...]
In: ActionScript3 as3, Tip · Tagged with: ActionScript3 as3, clearTimeout, clock, delay, pause, setTimeout, timer
ActionScript: Throw bullets to mouse direction
After calculating the angle of 2 graphic objects, you can also use this angle to throw a bullet to the object direction with the trigonometry. How ? Calculating the angle (in radian) between 2 graphics objects with the Math.atan2 method (cf. Orient object to the mouse cursor). On click, display a bullet to the “tank” [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: angle, bullet, direction, mouse, radian, shoot em up
ActionScript: Detect collision between 2 circles
With the Pythagoeran theorem you can detect collision with 2 circles. You just have to get the rays of 2 circles with the width property divided by 2. Actually the width property returns the diameter of the circle. So, you can calculte the ray like this: ray = diamter / 2 ray = circle.width / [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: 2 collision, as3, distance, pythagoeran, test
ActionScript: Get distance between 2 MovieClips
If you want to get the distance in pixels between 2 graphic objects just use the Pythagorean theorem in ActionScript :). c² = a² + b² Download source : Get_Distance.zip 12345function getDistance(pObj1:MovieClip,pObj2:MovieClip):Number { var distX:Number = pObj1.x – pObj2.x; var distY:Number = pObj1.y [...]
In: ActionScript3 as3, Game Design, Tip, Tutorial · Tagged with: 2, collision, distance, movieclip, pixel, pythagore
