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 / game_pause_and_cam_shake.lua
Last active June 28, 2022 08:54
Camera Shake and Global Pause Effects
-- Created for my Ko-fi article about my game
-- dev journey with my retro platformer
-- https://ko-fi.com/post/ENGHUN-Unnamed-Project--Making-Abilites-Look-B-X8X2DH3X2
-- Code is In progress, heavily not optimized
-- and geared towards readability until PICO_8
-- token counts come into play
-- Update Cycle for the game, notice that we
-- do not update core gameplay things if we
@Achie72
Achie72 / semisolid_flag_check.lua
Last active June 28, 2022 08:55
Check Semi Solids with Flag 2
-- Created for my Ko-fi article about my game
-- dev journey with my retro platformer
-- https://ko-fi.com/post/ENGHUN-Unnamed-Project--Making-Abilites-Look-B-X8X2DH3X2
-- Code is In progress, heavily not optimized
-- and geared towards readability until PICO_8
-- token counts come into play
function collide_floor(obj,width,height)
--only check for ground when falling.
@Achie72
Achie72 / explode.p8
Created August 10, 2022 10:07
Witch Game Explosions
-- Created for my Ko-fi article about my game
-- dev journey with my witch smup game
-- https://ko-fi.com/post/ENGHUN-Unnamed-Project--Making-Abilites-Look-B-X8X2DH3X2
-- Code is In progress, heavily not optimized
-- and geared towards readability until PICO_8
-- token counts come into play
-- creating the particles. We use sx and sy parameters
@Achie72
Achie72 / attack_mission.p8
Last active August 10, 2022 10:18
Attack Mission declaration for enemies
-- Created for my Ko-fi article about my game
-- dev journey with my witch smup game
-- https://ko-fi.com/post/ENGHUN-Unnamed-Project--Making-Abilites-Look-B-X8X2DH3X2
-- Code is In progress, heavily not optimized
-- and geared towards readability until PICO_8
-- token counts come into play
elseif enemy.mission == "attack" then
@Achie72
Achie72 / playerMovement.lua
Created October 7, 2022 21:05
TIC-80 Player Movement
-- variable to save if the player is moving
-- in a direction sideways, for us to make
-- the ship lean in said way
leaning = 0
if btn(0) then
y=y-speed
end
if btn(1) then
y=y+speed
@Achie72
Achie72 / upgradeSystem.lua
Last active April 10, 2023 09:54
Upgrade System
-- made for Rogala, my Devtober 2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/Post/Eng-Devtober2022-3--MORE-UPGRADES-R6R3FL67S
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
-- globals we need
levelUp = false
lvl = 1
upgrades = {5,0,0,0,0,3}
@Achie72
Achie72 / outline.lua
Last active October 10, 2022 20:52
TIC-80 outline
-- made for my Devtober2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/Eng-Devtober2020-2--Graphical-Enhancements-X8X3FKCIB
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
function draw_outline(_spr,_x,_y,_bg,_clr)
--palette address in memory
local palette_map = 0x3ff0
-- loop through colors and set all of them to the outline color.
@Achie72
Achie72 / healthBarIndication.lua
Last active October 10, 2022 20:52
TIC-80 HealthBar
-- made for my Devtober2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/Eng-Devtober2020-2--Graphical-Enhancements-X8X3FKCIB
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
function add_enemy(_x,_tpe,_family)
local enemy = {
x = _x,
y = -4,
sx = 0,
@Achie72
Achie72 / explodingBulletAreas.lua
Last active October 10, 2022 20:52
TIC-80 shmup exoloding/shrapnel bullets
-- made for my Devtober2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/Eng-Devtober2022-3--MORE-UPGRADES-R6R3FL67S
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
-- cricl-rect collision from the interwebs
function collidec(_circ, _obj)
local circDX = math.abs(_circ.x - _obj.x+_obj.cw/2)
local circDY = math.abs(_circ.y - _obj.y+_obj.cw/2)
@Achie72
Achie72 / dodge.lua
Last active October 12, 2022 18:19
TIC-80 Dodge Glitch effect
-- made for my Devtober2022 entry
-- you can read the corresponding devlog on:
-- https://ko-fi.com/post/Eng-Devtober2022-4--We-got-to-have-glitch-effe-S6S1FM1IC
-- https://itch.io/jam/devtober-2022/topic/2406837/achies-devlog-shmup-game
if dodgeTimer > 0 then
-- do it for each y level
for i=0,7 do
if math.random() > 0.5 then
local startLine = math.random(-10,0)
local endLine = math.random(0,10)