Added basic player movement.

This commit is contained in:
YourWishes committed 2021-04-23 08:17:42 +10:00
1 parent f7c1380f06
commit e323cf2721
23 files changed
+428 -14

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
/**
* Copyright (c) 2021 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#pragma once
#define GAMETIME_STEP 0.016
typedef struct {
/**
* Current time (as a float of seconds since game start).
*
* When time is initialized this will start at a fixed value of 2/60ths of a
* second, regardless of what engine the game is running.
*
* This is to avoid any divide by zero errors.
*/
float current;
/**
* Last Time (as a float of seconds since the game start).
*
* This value will start at 1/60th of a second regardless of engine the game
* is running on to avoid divide by zero errors.
*/
float last;
/**
* Fixed timestep that occured since the last frame. Typically locked to 1/60
* steps per second.
*/
float delta;
} gametime_t;
extern gametime_t TIME_STATE;