Skip to content

Commit

Permalink
formatted with pico8-ls 4d1e7885f81c611a013a099dd48a0e93822c09a4
Browse files Browse the repository at this point in the history
  • Loading branch information
beetrootpaul committed Oct 18, 2022
1 parent 3b19c45 commit cb810b0
Show file tree
Hide file tree
Showing 52 changed files with 701 additions and 1,455 deletions.
17 changes: 1 addition & 16 deletions src/cart_main.lua
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
-- -- -- -- -- -- --
-- cart_main.lua --
-- -- -- -- -- -- --

_game_version = "V0.3.0"

local current_screen, next_screen

function _init()
local preselected_mission_number = _get_cart_param(1)
-- DEBUG:
--preselected_mission_number = 1

-- to clear cart data, go to cart data folder (defined as "root_path" in "$HOME/Library/Application Support/pico-8/config.txt")
-- and delete "brp_dart-07.p8d.txt" file
cartdata("brp_dart-07")

current_screen = preselected_mission_number and
new_screen_title(preselected_mission_number, true, false, false) or
new_screen_brp()
current_screen = preselected_mission_number and new_screen_title(preselected_mission_number, true, false, false) or new_screen_brp()
-- DEBUG:
--current_screen = new_screen_controls(preselected_mission_number)
--current_screen = new_screen_title(preselected_mission_number, false, true, false)
--current_screen = new_screen_select_mission(preselected_mission_number)

current_screen._init()
end

function _update60()
next_screen = current_screen._post_draw()

if next_screen then
current_screen = next_screen
current_screen._init()
end

current_screen._update()
end

Expand All @@ -46,22 +36,17 @@ end
-- TODO: polishing: music: mission 2 boss
-- TODO: polishing: music: mission 3
-- TODO: polishing: music: mission 3 boss

-- TODO: polishing: sprites: mission 2: enemies
-- TODO: polishing: sprites: mission 2: boss
-- TODO: polishing: sprites: mission 3: enemies
-- TODO: polishing: sprites: mission 3: boss

-- TODO: balancing: powerup distributions: mission 2
-- TODO: balancing: powerup distributions: mission 3
-- TODO: balancing: mission 2: enemy types, health, speed, their bullets: timer, speed, amount, angles, timer, SFX or not
-- TODO: balancing: mission 3: enemy types, health, speed, their bullets: timer, speed, amount, angles, timer, SFX or not

-- TODO: carts: label images: mission 2
-- TODO: carts: label images: mission 3

-- TODO: check if no DEBUG code is left uncommented

-- TODO: consider this left-right enemy type for mission 2
-- enemy: left-right
--[76] = {
Expand Down
22 changes: 5 additions & 17 deletions src/cart_main/screen_brp.lua
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
-- -- -- -- -- -- -- -- -- -- --
-- cart_main/screen_brp.lua --
-- -- -- -- -- -- -- -- -- -- --

function new_screen_brp()
local screen_frames = 150
local fade_frames = 24
local screen_timer = new_timer(screen_frames)
local fade_in_timer = new_timer(fade_frames)
local present_timer = new_timer(screen_frames - 2 * fade_frames - 20)
local fade_out_timer = new_timer(fade_frames)

--

local screen = {}

function screen._init()
music(0)
end

function screen._update()
screen_timer._update()

if fade_in_timer.ttl > 0 then
fade_in_timer._update()
elseif present_timer.ttl > 0 then
Expand All @@ -29,10 +24,9 @@ function new_screen_brp()
fade_out_timer._update()
end
end

function screen._draw()
cls(_color_0_black)

local bg_pattern = 0xffff
local brp_color = _color_15_peach
if fade_in_timer.passed_fraction() < .33 then
Expand All @@ -55,24 +49,18 @@ function new_screen_brp()
bg_pattern = 0x0000
brp_color = _color_2_darker_purple
end

if fade_out_timer.passed_fraction() < 1 then
pal(_color_10_unused, brp_color)
sspr(
99, 114,
29, 14,
(_vs - 29 * 2) / 2, (_vs - 14 * 2) / 2,
29 * 2, 14 * 2
)
sspr(99, 114, 29, 14, _vs - 29 * 2 / 2, _vs - 14 * 2 / 2, 29 * 2, 14 * 2)
pal(1)
end
end

function screen._post_draw()
if screen_timer.ttl <= 0 then
return new_screen_title(1, false, true, false)
end
end

return screen
end
34 changes: 8 additions & 26 deletions src/cart_main/screen_controls.lua
Original file line number Diff line number Diff line change
@@ -1,88 +1,70 @@
-- -- -- -- -- -- -- -- -- -- -- --
-- cart_main/screen_controls.lua --
-- -- -- -- -- -- -- -- -- -- -- --

function new_screen_controls(preselected_mission)
local x_sprite = new_static_sprite("15,6,56,0", true)
local x_pressed_sprite = new_static_sprite("15,6,56,6", true)
local c_o_sprite = new_static_sprite("15,6,56,24", true)
local pause_sprite = new_static_sprite("15,6,41,0", true)

local proceed = false

local function draw_controls(base_x, base_y)
function draw_controls(base_x, base_y)
local y = base_y

print("in \-fgame:", base_x, y, _color_15_peach)
y = y + 10

print("use \-farrows \-fto \-fmove", base_x, y, _color_6_light_grey)
y = y + 10

print("press \-f& \-fhold", base_x, y, _color_6_light_grey)
x_sprite._draw(-_gaox + base_x + 49, y - 1)
print("to \-ffire", base_x + 67, y, _color_6_light_grey)
y = y + 10

print("press", base_x, y, _color_6_light_grey)
c_o_sprite._draw(-_gaox + base_x + 23, y - 1)
print("to \-ftrigger", base_x + 41, y, _color_6_light_grey)
print("a \-fshockwave", base_x, y + 7, _color_6_light_grey)
y = y + 20

print("other:", base_x, y, _color_15_peach)
y = y + 10

print("press", base_x, y, _color_6_light_grey)
pause_sprite._draw(-_gaox + base_x + 23, y - 1)
print("to \-fopen", base_x + 41, y, _color_6_light_grey)
print("the \-fpause \-fmenu", base_x, y + 6, _color_6_light_grey)
y = y + 16

print("press", base_x, y, _color_6_light_grey)
x_sprite._draw(-_gaox + base_x + 23, y - 1)
print("to \-fconfirm", base_x + 41, y, _color_6_light_grey)
end

local function draw_back_button(base_x, base_y)
function draw_back_button(base_x, base_y)
local w = _vs - 2 * base_x

-- button shape
sspr(35, 12, 1, 12, base_x, base_y, w, 12)

-- button text
print("back", base_x + 4, base_y + 3, _color_14_mauve)

-- "x" press incentive
local sprite = _alternating_0_and_1() == 0 and x_sprite or x_pressed_sprite
sprite._draw(-_gaox + base_x + w - 16, base_y + 13)
end

--

local screen = {
_init = _noop,
}

local screen = {_init = _noop}
function screen._update()
if btnp(_button_x) then
_sfx_play(_sfx_options_confirm)
proceed = true
end
end

function screen._draw()
cls(_color_1_darker_blue)

draw_controls(15, 12)
draw_back_button(15, 104)
end

function screen._post_draw()
if proceed then
return new_screen_title(preselected_mission, false, false, true)
end
end

return screen
end
Loading

0 comments on commit cb810b0

Please sign in to comment.