The update process will determine the current delta time, reset the collision markers, and do the collision checks. It also will check the buttons of the game pad.
1. The first change is to add a
Select
statement inside theIf
statement that depends on the fieldgameMode
.Method OnUpdate:Int() Local d:Float = Float(eng.CalcDeltaTime())/60.0 If isSuspended = False then Select gameMode
2. Check whether the game mode is equal to
gmPlay
.Case gmPlay
3. Reset the number of crates that are on a target.
OnTarget = 0
4. Also, reset whether the player's collision zones hit a wall or a crate.
hitWall = False hitWall2 = False hitCrate = Null hitCrate2 = Null
5. Perform a collision check on the game layer.
eng.CollisionCheck(layerGame) eng.Update(Float(d))
While playing a level, we want the player to be able to switch back to the titlescreen.
6. Check whether the X key was hit on either the keyboard or the Xbox controller.
If KeyHit(KEY_X) Or JoyHit(JOY_X)...