Shell code for P2-2 in ECE 2035 (Fall 2017) at Georgia Tech. This repo includes a game engine for a Labyrinth-style ball game.

Dependencies:   4DGL-uLCD-SE mbed wave_player

physics.h

Committer:
rconnorlawson
Date:
2017-11-08
Revision:
1:c18c231cb299
Parent:
0:cf4396614a79

File content as of revision 1:c18c231cb299:

#pragma once

/**
 * The main state structure for the game.
 * This structure holds all the global state for the game, and is updated during
 * the game loop. When you implement the "jump back" feature, this is the 
 * structure you need to save/restore.
 */
struct Physics {    
    float px, py; // Ball position
    float vx, vy; // Ball velocity
    float ax, ay; // Ball acceleration
};

/**
 * Performs one step of Forward Euler integration, given a time step delta.
 *
 * @param[out] out   The structure to store the result of the integration.
 * @param[in]  in    The current state of the system.
 * @param[in]  delta The time step, in seconds.s
 */
void forward_euler(Physics* state, float delta);