Rick Posted November 29, 2009 Share Posted November 29, 2009 So from what I know if you just make a variable and assign it a value it'll be global unless you put local in front of it. So in the fpscontroller.lua file (which seems to be the file that gets played when you run game from the editor) I make a variable and set it to true: runGame = true Then for the main game loop I do: while runGame do ... end Then I load the monster truck entity just to test this out. I just need an entity to have it's Update() method called each frame. I make a small change inside the Update() method of the monster truck: function Update(model) local model local entity for model,entity in pairs(entitytable) do entity:UpdateTires() end if KeyHit(KEY_ESCAPE) == 1 then runGame = false end end But when I press ESCAPE, the game doesn't end. What gives? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.