This file contains hidden or 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 hidden or 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 hidden or 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
// -=COLLISION RESOLUTION =- | |
results = Collision.testShapes(sprite_collider, Main.block_collider_pool); | |
for(collision in results) { | |
trace(collision.unitVector); | |
if(draw_collider) { | |
debug_text.visible = true; | |
debug_text.text = 'separation: ' +collision.separation; | |
} else { | |
debug_text.visible = false; | |
} |
This file contains hidden or 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 config(config:luxe.AppConfig) { | |
config.preload.textures.push({ id:'assets/star.png' }); | |
config.preload.textures.push({ id:'assets/ship.png' }); | |
config.preload.textures.push({ id:'assets/beam.png' }); | |
return config; | |
} //config |
This file contains hidden or 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
for(layer in map1.layers) { | |
if(layer.name == 'collider') { | |
layer.visible = false; | |
} | |
} |
This file contains hidden or 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 onenter<T>( _value:T ) { | |
earth = new Sprite({ | |
texture : earth_texture, | |
pos : new Vector(Luxe.screen.w/2, Luxe.screen.h), | |
}); | |
transformGesture = new TransformGesture(); | |
transformGesture.events.listen(GestureEvent.GESTURE_BEGAN, onTransformGesture); | |
transformGesture.events.listen(GestureEvent.GESTURE_CHANGED, onTransformGesture); |
This file contains hidden or 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.options.GeometryOptions; | |
import luxe.Vector; | |
import phoenix.Batcher; | |
import phoenix.geometry.Geometry; | |
import phoenix.geometry.Vertex; | |
class TriangleGeometry extends Geometry { | |
public function new(?options: TriangleOptions) { |
This file contains hidden or 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 update(dt:Float) { | |
if(Luxe.time - count_time > 0.5) { | |
count_time = Luxe.time; | |
fps_text.text = 'FPS: ' + Std.int(1.0 / Luxe.dt); | |
} | |
} //update |
This file contains hidden or 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 update(dt:Float) { | |
velocity.x += acceleration.x * dt; | |
monster.pos.x += velocity.x * dt; | |
velocity.y += acceleration.y * dt; | |
monster.pos.y += velocity.y * dt; | |
if(Luxe.input.inputdown('right')) { | |
acceleration.x = move_speed; | |
} |
This file contains hidden or 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
Process: adrifter [32903] | |
Path: /Users/USER/*/adrifter.app/Contents/MacOS/adrifter | |
Identifier: com.jonathanhirz.adrifter | |
Version: 0.0.1 (1) | |
Code Type: X86-64 (Native) | |
Parent Process: node-mac [32205] | |
Responsible: Terminal [340] | |
User ID: 501 | |
Date/Time: 2015-12-15 17:28:33.031 -0800 |