- Add .DS_Store, unused/, .vscode/settings.json to .gitignore - Add .editorconfig (tabs for Lua, LF, UTF-8) - Fix duplicate submodule entry in .gitmodules - Add Tags table (player, tank, ground, granade, ammoCrate) — replace magic numbers - Add SCREEN_W/SCREEN_H constants - Fix leaked global variable `c` in Game.lua - Remove Noble.showFPS = true from BomberScene - Remove debug print() calls from granade, enemy, BomberScene - Fix clean_build_dir glob bug in both build scripts - Make PLAYDATE_SDK_PATH configurable via env var
225 lines
4.9 KiB
Lua
225 lines
4.9 KiB
Lua
import "CoreLibs/easing"
|
|
import "CoreLibs/object"
|
|
import "CoreLibs/sprites"
|
|
import "CoreLibs/timer"
|
|
import "CoreLibs/ui"
|
|
import "CoreLibs/math"
|
|
|
|
-- Libraries
|
|
import 'libraries/noble/Noble'
|
|
import "libraries/AnimatedSprite"
|
|
import "libraries/pdParticles"
|
|
import "libraries/playout"
|
|
import "libraries/pdDialogue"
|
|
|
|
import 'utilities/enum'
|
|
import 'utilities/ui'
|
|
import 'utilities/utils'
|
|
|
|
ZIndex = {
|
|
player = 4,
|
|
enemy = 3,
|
|
props = 3,
|
|
fx = 6,
|
|
ui = 10,
|
|
alert = 12,
|
|
ground = 100,
|
|
flash = 101,
|
|
foreground = 102
|
|
}
|
|
CollideGroups = {
|
|
player = 1,
|
|
enemy = 2,
|
|
props = 3,
|
|
items = 4,
|
|
wall = 5,
|
|
granade = 6
|
|
}
|
|
|
|
Tags = {
|
|
player = 1,
|
|
tank = 2,
|
|
ground = 3,
|
|
granade = 154,
|
|
ammoCrate = 155,
|
|
}
|
|
|
|
SCREEN_W = 400
|
|
SCREEN_H = 240
|
|
|
|
Maps = {
|
|
{
|
|
id = 1,
|
|
name = "Vovchansk",
|
|
description = "This is a map",
|
|
locked = false,
|
|
unlockMissions = 0,
|
|
killTarget = 10,
|
|
},
|
|
{
|
|
id = 2,
|
|
name = "Mariupol",
|
|
description = "This is a map",
|
|
locked = true,
|
|
unlockMissions = 3,
|
|
killTarget = 15,
|
|
}
|
|
}
|
|
|
|
Modes = {
|
|
fpv = "FPV",
|
|
bomber = "Bomber"
|
|
}
|
|
|
|
Drones = {
|
|
{
|
|
id = 1,
|
|
mode = Modes.fpv,
|
|
name = "Quad FPV",
|
|
description =
|
|
"This is a quadrocopter with a camera on it. It's a good drone for beginners. It's easy to control and has a good battery life.",
|
|
price = 100,
|
|
locked = false,
|
|
preview = Graphics.image.new("assets/sprites/assemble/1/preview.png"),
|
|
full = Graphics.image.new("assets/sprites/assemble/1/8.png")
|
|
},
|
|
{
|
|
id = 2,
|
|
mode = Modes.bomber,
|
|
name = "Bomber",
|
|
description = "This is a drone",
|
|
price = 200,
|
|
stockPrice = 50,
|
|
locked = false,
|
|
preview = nil,
|
|
full = nil
|
|
},
|
|
{
|
|
id = 3,
|
|
name = "Drone 3",
|
|
description = "This is a drone",
|
|
price = -1,
|
|
locked = true,
|
|
preview = nil,
|
|
full = nil
|
|
},
|
|
{
|
|
id = 4,
|
|
name = "Drone 4",
|
|
description = "This is a drone",
|
|
price = -1,
|
|
locked = true,
|
|
preview = nil,
|
|
full = nil
|
|
}
|
|
}
|
|
|
|
import "scripts/player"
|
|
import "scripts/bigBoomSprite"
|
|
import "scripts/bomber/boom"
|
|
import "scripts/groundSprite"
|
|
import "scripts/balebaSprite"
|
|
import "scripts/dangerSprite"
|
|
import "scripts/tankSprite"
|
|
import "scripts/progressBar"
|
|
import "scripts/selectionSprite"
|
|
import "scripts/DroneCard"
|
|
import "scripts/pageSprite"
|
|
import "scripts/MapCard"
|
|
import "scripts/bomber/movableCrosshair"
|
|
import "scripts/bomber/granade"
|
|
import "scripts/bomber/explosionMark"
|
|
import "scripts/bomber/enemy"
|
|
import "scripts/bomber/ammoCrate"
|
|
import "scripts/bomber/smokeCloud"
|
|
import "scripts/bomber/floatingText"
|
|
import "scripts/bomber/allyBullet"
|
|
import "scripts/bomber/noiseAnimation"
|
|
import "scenes/BaseScene"
|
|
import 'scenes/Assemble'
|
|
import 'scenes/DroneCardSelector'
|
|
import 'scenes/Menu'
|
|
import 'scenes/Game'
|
|
import 'scenes/MapSelector'
|
|
import 'scenes/bomber/BomberScene'
|
|
|
|
Difficulty = {
|
|
Easy = "Easy",
|
|
Medium = "Medium",
|
|
Hard = "Hard"
|
|
}
|
|
|
|
DifficultySettings = {
|
|
[Difficulty.Easy] = {
|
|
assebleTime = 1700,
|
|
distance = 200
|
|
},
|
|
[Difficulty.Medium] = {
|
|
assebleTime = 1000,
|
|
distance = 350
|
|
},
|
|
[Difficulty.Hard] = {
|
|
assebleTime = 500,
|
|
distance = 500
|
|
}
|
|
}
|
|
|
|
Noble.Settings.setup({
|
|
difficulty = Difficulty.Medium,
|
|
music = true,
|
|
debug = false
|
|
})
|
|
|
|
Targets = {
|
|
{
|
|
id = "tank",
|
|
name = "Tank",
|
|
sprite = "assets/sprites/targets/tank",
|
|
spriteD = "assets/sprites/targets/tank_dead",
|
|
briefing = [[The drone is assembled and operational. We are ready for the mission.
|
|
|
|
An enemy tank is confirmed in the field. It threatens our advance.
|
|
|
|
Your task: eliminate the target. Clear the path for our assault units.
|
|
|
|
This operation is crucial. Execute with precision. Command out.]],
|
|
},
|
|
{
|
|
id = "btr",
|
|
name = "BTR",
|
|
sprite = "assets/sprites/targets/btr",
|
|
spriteD = "assets/sprites/targets/btr_dead",
|
|
briefing = [[The drone is assembled and operational. We are ready for the mission.
|
|
|
|
An enemy BTR has been spotted moving through the area. It's transporting troops.
|
|
|
|
Your task: hit the BTR before it reaches the frontline. Stop the reinforcements.
|
|
|
|
Time is critical. Strike hard. Command out.]],
|
|
},
|
|
}
|
|
|
|
CurrentMission = {
|
|
mapId = 1,
|
|
droneId = 1,
|
|
targetIndex = 1,
|
|
}
|
|
|
|
Noble.GameData.setup({
|
|
drone1 = 0,
|
|
drone2 = 0,
|
|
drone3 = 0,
|
|
drone4 = 0,
|
|
money = 500,
|
|
bomberStock = 3,
|
|
missionsCompleted = 0,
|
|
})
|
|
|
|
playdate.display.setRefreshRate(50)
|
|
|
|
Noble.showFPS = false
|
|
|
|
|
|
--Noble.new(BomberScene)
|
|
Noble.new(Menu)
|