-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobals.lua
85 lines (64 loc) · 2.04 KB
/
globals.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
----------------------------------------------------------------------------------------------------
-- Code setting up all the global variables to be used
----------------------------------------------------------------------------------------------------
function loadExternalAssets()
ss1 = love.graphics.newImage("assets/ss1.png")
ss2 = love.graphics.newImage("assets/ss2.png")
pixelFont = love.graphics.newFont("assets/basis33.ttf", 16)
end
function setVariables()
uiFont = love.graphics.getFont() -- default font
dragCursor = love.mouse.getSystemCursor("sizewe")
WIDTH = 1000
HEIGHT = 800
-- Mouse click interactions
dragging = false
draggingType = nil -- `force` or `angle`
mouseXinitial = 0
mouseXcurrent = 0
-- FUN kaleidoscope time!
-- colorMode = 1
-- bullet type (should be changeable by player)
bulType = 1
-- set number of bullets
numOfBullets = 10
-- set number of Planets
numOfPlanets = 7
allPlanets = {} -- each planet will have `mass`, `r`, `x`, `y`
allBullets = {} -- list of bullets, each will have `x`, `y`, and `vx`, `vy` (velocity x & y components)
player1 = {
x = 100,
y = 100,
angle = 0,
force = 1.5,
lives = 3,
health = 100,
lastAngle = nil,
lastForce = nil,
}
player2 = {
x = 500,
y = 500,
angle = 180,
force = 1.5,
lives = 3,
health = 100,
lastAngle = nil,
lastForce = nil,
}
-- whose turn
turn = 1
-- used to end the turn sometime
shotInProgress = false
-- integer to provide time-out so your bullet doesn't kill you in the first 50 iterations
-- benign while it's less than 50 iterations of bullet flight, for example (see collision check)
benign = 0
-- if end of round = 1 it restarts the game after all the bullets end their path
endOfRound = false
-- kaleidoscope mode colors for shot trails
rainbow = {
r = 1,
g = 1,
b = 1
}
end