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
results = Collision.testShapes(sprite_collider, Main.block_collider_pool); | |
for(collision in results) { | |
if(collision.separation.y > 0) { | |
sprite.pos.y = collision.shape2.position.y - 10 - sprite.size.y/2; | |
v_velocity = 0; | |
is_in_air = false; | |
} | |
} |
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
function load_isometric_tiledmap() { | |
Luxe.loadText('assets/isotiles.tmx', function(res){ | |
tiled_iso = new TiledMap( { tiled_file_data:res.text, pos : new Vector(256,128) } ); |
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
var flameHitResults : Array<CollisionData> = Collision.testShapes(engineDamageFlameCollider, StateGamePlay.asteroidColliderPool); | |
if(flameHitResults.length > 0) { | |
for(hit in flameHitResults) { | |
for(asteroid in StateGamePlay.asteroidPool) { | |
if(hit.shape2.name == asteroid.name) { | |
asteroid.destroy(); | |
asteroid = null; | |
StateGamePlay.asteroidColliderPool.splice(StateGamePlay.asteroidColliderPool.indexOf(hit.shape2), 1); | |
hit.shape2.destroy(); | |
} |
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
// finally some collision checks!! | |
var shipHitResults : Array<CollisionData> = Collision.testShapes(shipCollider, StateGamePlay.asteroidColliderPool); | |
if(shipHitResults.length > 0) { | |
shipHitCount++; | |
trace("ship hit " + shipHitCount); | |
} | |
var flameHitResults : Array<CollisionData> = Collision.testShapes(engineDamageFlameCollider, StateGamePlay.asteroidColliderPool); | |
if(flameHitResults.length > 0) { | |
for(hit in flameHitResults) { | |
for(asteroid in StateGamePlay.asteroidPool) { |
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
:base { | |
center-x: screen.center-x; | |
center-y: screen.center-y; | |
w: <= screen.w * 0.6; | |
h: <= screen.h * 0.6; | |
w: >= 280; | |
w: <= 500; | |
h: >= 160; |
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
import luxe.Component; | |
import luxe.Sprite; | |
import luxe.Color; | |
import luxe.Vector; | |
import luxe.tween.Actuate; | |
class ColorTweenComponent extends Component { | |
var sprite : Sprite; |
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
import luxe.Component; | |
import luxe.Sprite; | |
import luxe.Color; | |
import luxe.Vector; | |
import luxe.tween.Actuate; | |
class ColorRollComponent extends Component { | |
var sprite : Sprite; | |
var rad : Float = 0; |
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
import luxe.Component; | |
import luxe.Sprite; | |
import luxe.Color; | |
import luxe.Vector; | |
import luxe.utils.Maths; | |
class StarComponent extends Component { | |
var sprite : Sprite; |
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
override function ready() { | |
for(i in 0...numberOfStars) { | |
starSprite = new Sprite({ | |
name : 'star'+i, | |
size : new Vector(16, 16), | |
rotation_z : 45.0, | |
color : new Color().rgb(0xffffff), | |
pos : new Vector(Std.random(Std.int(Luxe.screen.w)), Std.random(Std.int(Luxe.screen.h))) | |
}); //starSprite |
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
var starSprite : Sprite; | |
var numberOfStars : Int = 300; |