-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgame.cpp
39 lines (32 loc) · 1.04 KB
/
game.cpp
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
#include "precomp.h" // include (only) this in every .cpp file
#include <iostream>
#include <vector>
// -----------------------------------------------------------
// Initialize the application
// -----------------------------------------------------------
void Game::Init()
{
}
// -----------------------------------------------------------
// Close down application
// -----------------------------------------------------------
void Game::Shutdown()
{
}
static Sprite rotatingGun( new Surface( "assets/aagun.tga" ), 36 );
static int frame = 0;
static int xlocation = 0;
// -----------------------------------------------------------
// Main application tick function
// -----------------------------------------------------------
void Game::Tick( float deltaTime )
{
std::cout << deltaTime << std::endl;
screen->Clear(80);
xlocation += 10;
if (xlocation >= SCRWIDTH) xlocation = 0;
rotatingGun.SetFrame(frame);
rotatingGun.Draw(screen, xlocation, 5);
frame++;
if (frame >= 36) frame = 0;
}