fpv/source/main.lua

133 lines
2.7 KiB
Lua
Raw Permalink Normal View History

2024-06-01 16:52:11 +03:00
import "CoreLibs/easing"
import "CoreLibs/object"
import "CoreLibs/sprites"
import "CoreLibs/timer"
import "CoreLibs/ui"
2024-06-03 20:08:46 +03:00
import "CoreLibs/math"
2024-06-01 16:52:11 +03:00
-- Libraries
import 'libraries/noble/Noble'
import "libraries/AnimatedSprite"
import "libraries/pdParticles"
import "libraries/playout"
import 'utilities/enum'
import 'utilities/ui'
2024-06-10 01:50:27 +03:00
import 'utilities/utils'
2024-06-01 16:52:11 +03:00
2024-06-02 20:25:27 +03:00
ZIndex = {
player = 4,
enemy = 3,
props = 3,
fx = 6,
ui = 10,
2024-06-03 00:31:15 +03:00
alert = 12,
ground = 100,
flash = 101
2024-06-02 20:25:27 +03:00
}
CollideGroups = {
player = 1,
enemy = 2,
props = 3,
items = 4,
wall = 5
}
2024-06-10 01:50:27 +03:00
Drones = {
{
2024-06-12 01:22:12 +03:00
id = 1,
2024-06-10 01:50:27 +03:00
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")
},
{
2024-06-12 01:22:12 +03:00
id = 2,
2024-06-10 01:50:27 +03:00
name = "Drone 2",
description = "This is a drone",
price = 200,
locked = true,
preview = nil,
full = nil
},
{
2024-06-12 01:22:12 +03:00
id = 3,
2024-06-10 01:50:27 +03:00
name = "Drone 3",
description = "This is a drone",
price = 300,
locked = true,
preview = nil,
full = nil
},
{
2024-06-12 01:22:12 +03:00
id = 4,
2024-06-10 01:50:27 +03:00
name = "Drone 4",
description = "This is a drone",
price = 400,
locked = true,
preview = nil,
full = nil
}
}
2024-06-01 16:52:11 +03:00
import "scripts/player"
2024-06-02 20:25:27 +03:00
import "scripts/bigBoomSprite"
2024-06-01 16:52:11 +03:00
import "scripts/groundSprite"
import "scripts/balebaSprite"
import "scripts/dangerSprite"
2024-06-01 22:46:36 +03:00
import "scripts/tankSprite"
2024-06-04 21:21:40 +03:00
import "scripts/progressBar"
2024-06-10 01:50:27 +03:00
import "scripts/selectionSprite"
2024-06-12 01:22:12 +03:00
import "scripts/DroneCard"
import "scripts/pageSprite"
2024-06-01 16:52:11 +03:00
import "scenes/BaseScene"
2024-06-10 01:50:27 +03:00
import 'scenes/Assemble'
2024-06-12 01:22:12 +03:00
import 'scenes/DroneCardSelector'
2024-06-01 16:52:11 +03:00
import 'scenes/Menu'
import 'scenes/Game'
2024-06-10 01:50:27 +03:00
Difficulty = {
Easy = "Easy",
Medium = "Medium",
Hard = "Hard"
}
DifficultySettings = {
[Difficulty.Easy] = {
2024-06-12 18:41:38 +03:00
assebleTime = 1700,
2024-06-12 19:02:03 +03:00
distance = 200
2024-06-10 01:50:27 +03:00
},
[Difficulty.Medium] = {
2024-06-12 18:41:38 +03:00
assebleTime = 1000,
2024-06-12 19:02:03 +03:00
distance = 350
2024-06-10 01:50:27 +03:00
},
[Difficulty.Hard] = {
2024-06-12 18:41:38 +03:00
assebleTime = 500,
2024-06-12 19:02:03 +03:00
distance = 500
2024-06-10 01:50:27 +03:00
}
}
2024-06-01 16:52:11 +03:00
Noble.Settings.setup({
2024-06-10 01:50:27 +03:00
difficulty = Difficulty.Medium,
2024-06-12 18:41:38 +03:00
music = true,
debug = true
2024-06-01 16:52:11 +03:00
})
2024-06-10 01:50:27 +03:00
Noble.GameData.setup({
drone1 = 0,
drone2 = 0,
drone3 = 0,
drone4 = 0,
money = 150
})
2024-06-01 16:52:11 +03:00
playdate.display.setRefreshRate(50)
2024-06-12 01:22:12 +03:00
Noble.showFPS = false
2024-06-01 16:52:11 +03:00
2024-06-10 01:50:27 +03:00
Noble.new(Menu)