Skip to content

Instantly share code, notes, and snippets.

View Achie72's full-sized avatar
💻
Probably doing some game jam

Achie Game Dev Achie72

💻
Probably doing some game jam
View GitHub Profile
@Achie72
Achie72 / textBubbles.lua
Last active October 11, 2022 20:05
TIC-80 Text Bubbles (onomatopoeia)
-- made for my Devtober2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/Eng-Devtober2022-5--Pew-Pew-L4L1FMRQL
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
-- create the usual adder function and the
-- respective collection
textBubbles = {}
function add_text_bubble(_x,_y,_sx,_sy,_txt,_clr,_bcolor,_maxAge)
@Achie72
Achie72 / love_shmup_movement.lua
Last active April 10, 2023 09:53
Löve Shmup Movement
-- made for Rogala, my Devtober 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/Post/Devtober2022-6--Movement-and-Elites-K3K1FUUGD
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
-- on enemy creation assign it's movement type
movements = {"downward", "sinus", "left-right", "downward", "left-right"}
enemy.movement = movements[_tpe],
@Achie72
Achie72 / director.lua
Last active April 10, 2023 09:53
Löve Shmup Spawn Director
-- made for Rogala, my Devtober 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/Post/Devtober2022-6--Movement-and-Elites-K3K1FUUGD
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
-- the director is a new object created that handles enemy
-- spawning. It has certain credits it can spend, and every
-- enemy and elite type has a cost attached to it.
-- In the future the director could be further tweaked, to
@Achie72
Achie72 / scoreSaving.lua
Last active April 10, 2023 09:52
Löve2D score saving
-- made for Rogala, my Devtober 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/Post/Devtober-9--Rogala-is-out-Catchup-and-Post-Mort-K3K3G1LU9
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
function load_high_scores()
local returnInfo = love.filesystem.getInfo("save/data.sav","file")
if not (returnInfo == nil) then
@Achie72
Achie72 / multiplerender.lua
Last active November 5, 2022 20:37
Multiple Entities Drawn - Pico-8, Game By It's Cover
-- made for my A Game By It's Cover 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/A-Game-By-Its-Cover-2--Couch-Co-op-Combat-Mock-E1E8G6HWY
-- https://itch.io/jam/a-game-by-its-cover-2022/topic/2445310/occult-nostalgia-devlog?before=3#post-6867824
function draw_characters()
local occupancyMap = {}
-- gather occupancy data
for character in all(characters) do
@Achie72
Achie72 / lina_fishy_recolor.lua
Last active April 10, 2023 09:43
Lina: Fishy Quest Sprite Recoloring
-- made for Lina: A Fishy Quest: https://www.lexaloffle.com/bbs/?tid=50185
-- https://ko-fi.com/achiegamedev
-- basic pico-8 palette swapping for recoloring same sprites
function draw_fishes()
for fish in all(fishes) do
if fish.tpe == 0 then
-- set draw colors, we use 7 and 6 as template color
-- on singular sprite, so we can draw all types of
@Achie72
Achie72 / enemy_detection.p8
Last active November 16, 2022 16:59
AGBIC Combat System
-- made for my A Game By It's Cover 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/A-Game-By-Its-Cover-3--Combat-POC-New-Enemies-L3L4GF2I3
-- https://itch.io/jam/a-game-by-its-cover-2022/topic/2445310/occult-nostalgia-devlog?before=3#post-6867824
function _update()
local activePlayer = players[active_player]
if turnIndicator == 0 then
if (activePlayer.actions) == 0 and (btnp(4)) then
@Achie72
Achie72 / add_enemy_to_new_tile.p8
Last active November 16, 2022 17:00
Add random enemies
-- made for my A Game By It's Cover 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/A-Game-By-Its-Cover-3--Combat-POC-New-Enemies-L3L4GF2I3
-- https://itch.io/jam/a-game-by-its-cover-2022/topic/2445310/occult-nostalgia-devlog?before=3#post-6867824
-- this is straight forward, when we create new tiles
-- we grab a random room type from our defined collection of them
-- If the new tile is not a road, just add a random enemy to it.
-- This is a debug working in the future we will define on which
@Achie72
Achie72 / pico8_outline.p8
Last active April 10, 2023 12:39
Pico-8 Sprite with color outline
-- https://ko-fi.com/achiegamedev
-- draw the myspr sprite at x and y with a 1 pixel
-- wide outline of clr. if clr is not given on the call
-- default 7 is used instead. thickness is how thick the outline
-- should be in pixels. defaults to 1 if none given
function draw_outline(myspr, x, y, clr, thickness, x_size, y_size, flip_h, flip_v)
-- nil check for few parameters so you can
-- call much simple versions of the function, see first example in draw
-- nil is false if checked for boolean so flip_h and flip_v can stay nil
@Achie72
Achie72 / floating_sprites.p8
Last active February 26, 2023 14:29
PICO-8 Floating Resource Sprites
-- made for my Colony Management Pico-8 game
-- you can read the corresponding devlog on:
-- Devlog: https://ko-fi.com/post/Colony-Management-Project-1--The-first-few-days-A0A5J2DFS
-- todo: itch link
-- creation of the floating sprites
function add_float_sprite(_spr, _x, _y, _lifetime, _val, _remain)
local float = {
spr = _spr,
x = _x,