Skip to content

Instantly share code, notes, and snippets.

View dpeek's full-sized avatar

David Peek dpeek

View GitHub Profile
class GameScene extends Scene {
// ...
public override function update() {
// Keep camera.x centered on the player
HXP.camera.x = player.x - HXP.halfWidth + 64;
// Keep camera.y centered on the player,
// unless it would show below the map.
// In that case, keep to the bottom fo the map.