Created
April 21, 2014 18:28
-
-
Save ryzed/11151697 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BulletScript extends Script | |
{ | |
public var dir:V3 = new V3(); | |
public var speed:Float; | |
function new() | |
{ | |
// empty, for init members | |
} | |
function update(dt) | |
{ | |
var dt = Time.currDt; | |
var pos = transform.pos; | |
pos += (dir * (speed * dt)); | |
transform.pos = pos; | |
// check outside level | |
if (pos.length() > 32) | |
{ | |
owner.destroy(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment