flash on 2012-8-11
♥0 |
Line 33 |
Modified 2012-08-13 07:32:15 |
MIT License
archived:2017-03-30 08:33:27
ActionScript3 source code
/**
* Copyright hemingway ( http://wonderfl.net/user/hemingway )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/hdQ7
*/
package {
import com . bit101 . components.*;
import fl . transitions . easing.*;
import fl . transitions . *;
import flash . net . *;
import flash . text . *;
import flash . geom . *;
import flash . utils . *;
import flash . system . *;
import flash . events . *;
import flash . display . *;
import flash . filters . *;
public class Hero extends Sprite {
public const _g:int = 0.5;
public var _h:Sprite = new Sprite();
public var _vX:int;
public var _vY:int;
public function Hero():void {
_h.graphics.beginFill (0x000000, 0.5);
_h.graphics.drawRect ((stage.stageWidth/2)-25, (stage.stageHeight/2)-25, 50, 50);
_h.graphics.endFill ();
addChild(_h);
addEventListener(Event.ENTER_FRAME, Hero_Phys);
}
public function Hero_Phys(_o:Object):void {
if (_h.y - _h.height < (stage.stageHeight))
{
}else{
}
if (_vY < 10) {_vY += _g}
}
}
}