-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic.c
51 lines (51 loc) · 2.2 KB
/
logic.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "logic.h"
#include "gba.h"
//
//void initializeAppState(AppState* appState) {
// // TA-TODO: Initialize everything that's part of this AppState struct here.
// // Suppose the struct contains random values, make sure everything gets
// // the value it should have when the app begins.
// appState->state = MAIN_LEVEL_INIT;
//}
//
//// TA-TODO: Add any process functions for sub-elements of your app here.
//// For example, for a snake game, you could have a processSnake function
//// or a createRandomFood function or a processFoods function.
////
//// e.g.:
//// static Snake processSnake(Snake* currentSnake);
//// static void generateRandomFoods(AppState* currentAppState, AppState* nextAppState);
//
//// This function processes your current app state and returns the new (i.e. next)
//// state of your application.
//AppState processAppState(AppState *currentAppState, u32 keysPressedBefore, u32 keysPressedNow) {
// /* TA-TODO: Do all of your app processing here. This function gets called
// * every frame.
// *
// * To check for key presses, use the KEY_JUST_PRESSED macro for cases where
// * you want to detect each key press once, or the KEY_DOWN macro for checking
// * if a button is still down.
// *
// * To count time, suppose that the GameBoy runs at a fixed FPS (60fps) and
// * that VBlank is processed once per frame. Use the vBlankCounter variable
// * and the modulus % operator to do things once every (n) frames. Note that
// * you want to process button every frame regardless (otherwise you will
// * miss inputs.)
// *
// * Do not do any drawing here.
// *
// * TA-TODO: VERY IMPORTANT! READ THIS PART.
// * You need to perform all calculations on the currentAppState passed to you,
// * and perform all state updates on the nextAppState state which we define below
// * and return at the end of the function. YOU SHOULD NOT MODIFY THE CURRENTSTATE.
// * Modifying the currentAppState will mean the undraw function will not be able
// * to undraw it later.
// */
//
// AppState nextAppState = *currentAppState;
//
// UNUSED(keysPressedBefore);
// UNUSED(keysPressedNow);
//
// return nextAppState;
//}