Skip to content

Instantly share code, notes, and snippets.

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

Tóth Béla Achie72

💻
Probably doing some game jam
View GitHub Profile
@Achie72
Achie72 / palette_swap_samurai_draw.p8
Created January 23, 2024 16:53
Samurai Game Jam Devlog - One Last Swing #2 - Drawing Samurai
-- draw a samurai on the screen at _x and _y positions
-- _color holds a two element array for the palette swap
-- _head holds the head sprite of the samurai
-- _flip indicates two horizontally flip the whole thing
-- for opponent drawing
function draw_samurai(_x, _y, _color, _stance, _head, _flip)
-- offset for heads, because the base sprite is not symetrical.
local headOffset = {3,1}
if _flip then headOffset = {5,1} end
@Achie72
Achie72 / gist:593d9dce85bf60a272f99b09bd185232
Created January 4, 2024 17:09
PicoShorts January Candidates
Candidate List for my review Series: PicoShorts: https://github.com/Achie72/kofi-articles?tab=readme-ov-file#picoshorts
Golf Escape by Davbo: https://www.lexaloffle.com/bbs/?pid=139431#p
jetpack 1.2 by strirky: https://www.lexaloffle.com/bbs/?pid=139451#p
Rover defence by ggaughan: https://www.lexaloffle.com/bbs/?pid=139475#p
Cave Diving Gone Bad by taxicomics: https://www.lexaloffle.com/bbs/?pid=139584#p
Bounce Game by SaKo: https://www.lexaloffle.com/bbs/?pid=139631#p
@Achie72
Achie72 / line_of_sight_and_pathfinding.p8
Last active December 29, 2023 17:36
Crumbling Crypt - PICO-8 Line of sight and Pathfinding
-- Bresenham's line + A*
-- Made for Crumbling Crypt: https://ko-fi.com/Post/Crumbling-Crypt-1--A-minimalist-Roguelike-B0B1SPL7E
-- calc manthattan distance, which is the grid based
-- tile distance between two points
function heuristic(a, b)
return (abs(a.x - b.x)+ abs(a.y-b.y))
end
-- Insertion Sort by @impbox
@Achie72
Achie72 / building_rooms_from_corner_sprites.p8
Last active December 29, 2023 11:29
Crumbling Crypt - PICO-8 - Build map from sprites
-- Made for Crumbling Crypt: https://ko-fi.com/Post/Crumbling-Crypt-1--A-minimalist-Roguelike-B0B1SPL7E
-- Original version for my game called Kumatori Panic!: https://ko-fi.com/post/Kumatori-Panic-4--Eggs-Better-Movement-Lore-Ac-N4N0N6K7W
function build_room(corner_sprite_id, corner, _x, _y)
--printh("building room at: ".._x.." ".._y)
local idString = ""
-- indicate where the given sprite starts on
-- the sprite sheet.
local xStart = 0
local yStart = 0
@Achie72
Achie72 / map_digger.p8
Last active December 29, 2023 11:29
Crumbling Crypt - PICO-8 Map Generation with a digger/walker
-- General walker for dungeon template generation
-- Made for Crumbling Crypt: https://ko-fi.com/Post/Crumbling-Crypt-1--A-minimalist-Roguelike-B0B1SPL7E
function generate_dungeon()
-- random walker on an 8x8 grid on map
-- set rooms to 1 if there should be something
-- move randomly on if we are good
local roomNumber = 4+flr(player.level/2)
local xStart,yStart = flr(rnd(8)),flr(rnd(8))
mset(xStart,yStart,1)
@Achie72
Achie72 / scene.p8
Created November 5, 2023 10:52
Lina: Suika Hunt - Scene System
-- we start with the scene variable in init
scene = "menu"
-- then in update
function _update()
-- increase the tick
t+=1
if t > 29 then
t = 0
seconds += 1
@Achie72
Achie72 / coloring_the_combo_strings.p8
Created November 5, 2023 10:44
Lina: Suika Hunt - Coloring Combo Strings in PICO-8
-- color table to define which direction should have
-- which color during the printing
local colorTable = {
⬅️ = 9,
⬇️ = 10,
⬆️ = 11,
➡️ = 12
}
-- iterate through all elemenets in the fruitCollection
@Achie72
Achie72 / combo_string_system.p8
Created November 5, 2023 10:37
Lina: Suika Hunt - Combo System for PICO-8
-- function to build directional combo
-- with lenght of the parameter
-- 11 fruit types
function create_combo(_length)
-- combo options
local comboTable = {"⬅️","⬇️","⬆️","➡️"}
-- combo string in build
local combo=""
-- create string equal to combo lenght
for i=1,_length do
@Achie72
Achie72 / gist:eb41737e34cf7cfdef2366099546e660
Last active September 22, 2023 20:58
Release Radar - August | PICO-8
Penguin Rush by m4ttbit - Race the iceberg to you den! Gather fish and escape the ever approaching glacier! - https://www.lexaloffle.com/bbs/?pid=133805#p
Another Tetris by Luife - Another Tetris clone - https://www.lexaloffle.com/bbs/?pid=133813#p
Gun Potato by RageBarbaari - Score Chaser Shmup where you shoot food - https://www.lexaloffle.com/bbs/?pid=133822#p
Vacay Volley by ejreyes - Help Ollie to juggle the volleyball as long as you can - https://www.lexaloffle.com/bbs/?pid=133840#p
Star Addict by Davi_Dash - Use your time to gather stars, dash and slide - https://www.lexaloffle.com/bbs/?pid=133841#p
DriftBomb by jnjbaggott1 - Asteroid like score chaser - https://www.lexaloffle.com/bbs/?tid=53970
Sine Surf by RoverKibb - Surf along a sine wave in this score chaser dodge'em up - https://www.lexaloffle.com/bbs/?pid=133936#p
Labyrint Runner by Witcherchan - An Impossible Game like maze runner - https://www.lexaloffle.com/bbs/?pid=133946#p
Pling Plong Galaxy! by EinarBrown - Circular Pong+Breakout mashup -
@Achie72
Achie72 / crea8_textbox.p8
Created September 20, 2023 19:03
TextBoxes for Crea8
function draw_box(x, y, w, h, style)
-- chip
if style == 0 then
-- the top-corner decal sprite
spr(240, x-1, y)
-- top
line(x, y, x+w-4, y, 7)
--left
line(x, y, x, y+h, 7)
-- bot