💾 Archived View for callistix.srht.site › projects › vshmup › pages › 002_initialstatus.gmi captured on 2024-08-31 at 11:43:30. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-02-05)
-=-=-=-=-=-=-
I've already did a few commits before starting this work log, so here a summary what's already there.
I've used Aseprite [1] to create a `png` spritesheet, containing 4 32x32 pixel squares with a player ship, an enemy ship, a friendly bullet, and an enemy bullet. The bullets are only 4x4 but they're occupying a full 32x32 square, I might optimise that later.
I wrote a bit of code which does the following:
This is the function which is called when the game loads. It mainly loads assets and initiates variables and tables.
This is the main game loop. `dt` contains the milliseconds since the last update.
In this function I evaluate if certain keys are pressed and initiate the corresponding actions. It does collision detection and updates positions of all entities.
This is a periodically called function to draw stuff on the screen. It's just that, it draws all the stuff on the screen.
This is a callback function which triggers whenever a key is pressed. It only evaluates the escape key and immediately quits.
This is called whenever the spacebar is held down. It emits a bullet at regular intervals.
This function evaluates all collisions, currently between shots and enemies, and enemies and the player.
This is called regularly to update the position of bullets that the player fired. They are removed if they're off screen.
Update positions and create new enemies at random intervals and positions. The enemies are removed once they're off screen.
That's it, you can move the ships around with the cursor keys, shoot enemies with `space`, and you will die if you crash into an enemy ship.
⬆ A vertical shoot'em'up game in Lua with LÖVE
Created: 25/Jan/2024
Modified: 25/Jan/2024