aboutsummaryrefslogtreecommitdiff
path: root/assets/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'assets/scripts')
-rw-r--r--assets/scripts/character-select.lua24
-rw-r--r--assets/scripts/local2P.lua3
-rw-r--r--assets/scripts/mainMenu.lua14
3 files changed, 35 insertions, 6 deletions
diff --git a/assets/scripts/character-select.lua b/assets/scripts/character-select.lua
new file mode 100644
index 0000000..c3f7e52
--- /dev/null
+++ b/assets/scripts/character-select.lua
@@ -0,0 +1,24 @@
+---@diagnostic disable: undefined-global
+
+characters = {"Cobalt Phantom", "Emerald Venom", "Golden Radiance", "Crimson Reaper"}
+player1Character = ""
+player2Character = ""
+
+function Setup()
+ print(characterSelectType)
+end
+
+function Update()
+ local fontFile = "assets/fonts/OpenSans-Bold.ttf"
+ local fontSize = 50
+ local text = "Character Select"
+
+ local textWidth = getTextWidth(fontFile, fontSize, text)
+ local x = (WIDTH - textWidth) // 2
+ local y = 20
+
+ queueTextForRender(text, fontFile, x, y, fontSize, 255, 255, 255, 255)
+
+
+
+end \ No newline at end of file
diff --git a/assets/scripts/local2P.lua b/assets/scripts/local2P.lua
index 5f5c233..635251b 100644
--- a/assets/scripts/local2P.lua
+++ b/assets/scripts/local2P.lua
@@ -1,6 +1,7 @@
---@diagnostic disable: undefined-global
function Setup()
+ setRenderPlayer(true)
end
function Update()
-end \ No newline at end of file
+end
diff --git a/assets/scripts/mainMenu.lua b/assets/scripts/mainMenu.lua
index 11c583a..7ed16cc 100644
--- a/assets/scripts/mainMenu.lua
+++ b/assets/scripts/mainMenu.lua
@@ -5,22 +5,27 @@ buttonHeight = 50;
buttonWidth = 110;
bigButtonWidth = 150;
bigButtonHeight = buttonHeight;
+characterSelectType = ""
function Setup()
- setRenderPlayer(false)
setBgImage("assets/backgrounds/city-background-1.png")
end
function Local2PButton()
- reloadWithScript("assets/scripts/local2P.lua")
+ characterSelectType = "Local2P"
+ dofile("assets/scripts/character-select.lua")
+ Setup()
end
function MultiplayerButton()
- -- Add C functions to reset Lua state and re-run Setup with different scripts
+ characterSelectType = "Multiplayer"
+ dofile("assets/scripts/multiplayer.lua")
+ Setup()
end
function SettingsButton()
- -- Add C functions to reset Lua state and re-run Setup with different scripts
+ dofile("assets/scripts/settings.lua")
+ Setup()
end
function Update()
@@ -28,7 +33,6 @@ function Update()
queueButtonForRender("Local 2P", WIDTH // 2 - buttonWidth // 2, HEIGHT // 2 - buttonHeight // 2, buttonWidth, buttonHeight, "Local2PButton");
queueButtonForRender("Multiplayer", WIDTH // 2 - bigButtonWidth // 2, HEIGHT // 2 - bigButtonHeight // 2 + 55, bigButtonWidth, bigButtonHeight, "MultiplayerButton");
queueButtonForRender("Settings", WIDTH // 2 - buttonWidth // 2, HEIGHT // 2 - buttonHeight // 2 + 55 + 55, buttonWidth, buttonHeight, "SettingsButton");
-
-- if keys[getKeycodeByName("RIGHT")] or keys[getKeycodeByName("D")] then
-- movePlayer(movementSpeed, 0)
-- end