Skip to content

Commit 8e3ca3b

Browse files
committed
ready to go tolibray
1 parent 0ec41f4 commit 8e3ca3b

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

CODE_STYLE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SpookyJam25 - Small code style guide
2+
3+
Principles
4+
- Prefer Flixel built-ins over custom helpers. Use FlxMath, FlxVelocity, FlxPoint, FlxG helpers where possible.
5+
- Keep code small, obvious, and easy to read. Avoid large helper functions in game object classes.
6+
- Comments: only short headers for public functions/constants and brief notes where behavior is non-obvious.
7+
8+
Examples
9+
- Use `FlxPoint.get()` / `put()` for temporary points.
10+
- Use `this.velocity.set(...)` to set movement for crisp control.
11+
12+
If in doubt: favor clarity and Flixel helpers.

source/Actions.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import flixel.input.actions.FlxActionInput.FlxInputDevice;
77
import flixel.input.actions.FlxActionInput.FlxInputDeviceID;
88
import flixel.input.actions.FlxActionManager;
99
import flixel.input.actions.FlxActionSet;
10-
import openfl.sensors.Accelerometer;
10+
// (no platform sensors used)
1111

1212
class Actions
1313
{

source/GameMap.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class GameMap extends FlxGroup
1414
public var floorMap:FlxTilemap;
1515
public var wallsMap:FlxTilemap;
1616

17-
// portal room info (tile coords and pixel coords)
17+
// portal info
1818
public var portalRoomIndex:Int = -1;
1919
public var portalTileX:Int = -1;
2020
public var portalTileY:Int = -1;

source/PlayState.hx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,13 @@ class PlayState extends FlxState
8383

8484
if (any)
8585
{
86-
// GameObject.move expects degrees
8786
var deg:Float = moveAngle * 180.0 / Math.PI;
8887
player.move(deg);
89-
move.put();
9088
}
9189
else
9290
{
93-
// stop instantly when no input
9491
player.stop();
95-
move.put();
9692
}
93+
move.put();
9794
}
9895
}

source/Player.hx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ class Player extends GameObject
1010
{
1111
super(X, Y);
1212
this.speed = SPEED;
13-
// accel will be derived as DEFAULT_ACCEL_MULT * speed by GameObject if unset
1413
makeGraphic(16, 16, FlxColor.WHITE);
1514
}
1615
}

0 commit comments

Comments
 (0)