Browse Source

LOCKED REFRESH RATE

tags/chalkboard
madiwka3 4 years ago
parent
commit
68971a2cd3
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      main.lua

+ 6
- 0
main.lua View File

@@ -13,6 +13,7 @@ vec4 effect(vec4 color, Image image, vec2 uvs, vec2 screen_coords) {
debug = true debug = true
--GLOBAL VARIABLES --GLOBAL VARIABLES
gameMode = "normal" gameMode = "normal"
ts = 0
globalState = "menu" globalState = "menu"
timeIsSlow = false timeIsSlow = false
timeIsSlow2 = false timeIsSlow2 = false
@@ -23,6 +24,7 @@ wall1width = 30
nuclearanimation = 3 nuclearanimation = 3
easternum = 0 easternum = 0
ball_DIR = 0 ball_DIR = 0
updaterate = 0.1
RED = 255 RED = 255
hitNum = {} hitNum = {}
hitNum[1] = 0 hitNum[1] = 0
@@ -698,6 +700,7 @@ function love.update(dt)
print("IMPORTANT!!!!!" .. globalState .. gameState) print("IMPORTANT!!!!!" .. globalState .. gameState)
staticanimatorcounter(dt) staticanimatorcounter(dt)
musicController('norm', 1) musicController('norm', 1)
ts = ts + dt
if debug then if debug then
displayFPS() displayFPS()
end end
@@ -707,6 +710,7 @@ function love.update(dt)
if globalState == "menu" then if globalState == "menu" then
debugCheck(dt) debugCheck(dt)
end end
if ts > updaterate then
if globalState == "nettest" then if globalState == "nettest" then
basegame(dt) basegame(dt)
nettest(dt) nettest(dt)
@@ -718,6 +722,8 @@ function love.update(dt)
end end
clienttest(dt) clienttest(dt)
end end
ts = ts - updaterate
end
end end
serverinit = false serverinit = false
clientinit = false clientinit = false


Loading…
Cancel
Save