Diffstat (limited to 'noncore/games/sfcave-sdl/player.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/player.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/sfcave-sdl/player.cpp b/noncore/games/sfcave-sdl/player.cpp index 2d52ae2..f024d6b 100644 --- a/noncore/games/sfcave-sdl/player.cpp +++ b/noncore/games/sfcave-sdl/player.cpp | |||
@@ -12,49 +12,49 @@ Player :: Player( int w, int h ) | |||
12 | sHeight = h; | 12 | sHeight = h; |
13 | 13 | ||
14 | thrust = 0.4; | 14 | thrust = 0.4; |
15 | gravity = 0.6; | 15 | gravity = 0.6; |
16 | maxUpSpeed = 4.0; | 16 | maxUpSpeed = 4.0; |
17 | maxDownSpeed = 5.0; | 17 | maxDownSpeed = 5.0; |
18 | 18 | ||
19 | explosion = new AnimatedImage( IMAGES_PATH "explosion.bmp", 15 ); | 19 | explosion = new AnimatedImage( IMAGES_PATH "explosion.bmp", 15 ); |
20 | init(); | 20 | init(); |
21 | } | 21 | } |
22 | 22 | ||
23 | Player :: ~Player() | 23 | Player :: ~Player() |
24 | { | 24 | { |
25 | if ( explosion ) | 25 | if ( explosion ) |
26 | delete explosion; | 26 | delete explosion; |
27 | } | 27 | } |
28 | 28 | ||
29 | void Player :: init() | 29 | void Player :: init() |
30 | { | 30 | { |
31 | // Set player position | 31 | // Set player position |
32 | pos.x( 50 ); | 32 | pos.x( 50 ); |
33 | pos.y( sWidth/2 ); | 33 | pos.y( sWidth/2 ); |
34 | pos.h( 2 ); | 34 | pos.h( 2 ); |
35 | pos.w( 4 ); | 35 | pos.w( 4 ); |
36 | thrust = 0; | 36 | currentThrust = 0; |
37 | crashing = false; | 37 | crashing = false; |
38 | crashLineLength = 0; | 38 | crashLineLength = 0; |
39 | crashed = false; | 39 | crashed = false; |
40 | explosion->reset(); | 40 | explosion->reset(); |
41 | allFaded = false; | 41 | allFaded = false; |
42 | expNextFrame = false; | 42 | expNextFrame = false; |
43 | 43 | ||
44 | // Reset Trail | 44 | // Reset Trail |
45 | for ( int i = 0 ; i < TRAILSIZE ; ++i ) | 45 | for ( int i = 0 ; i < TRAILSIZE ; ++i ) |
46 | { | 46 | { |
47 | trail[i].x( -1 ); | 47 | trail[i].x( -1 ); |
48 | trail[i].y( 0 ); | 48 | trail[i].y( 0 ); |
49 | trail[i].w( 2 ); | 49 | trail[i].w( 2 ); |
50 | trail[i].h( 2 ); | 50 | trail[i].h( 2 ); |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | void Player :: draw( SDL_Surface *screen ) | 54 | void Player :: draw( SDL_Surface *screen ) |
55 | { | 55 | { |
56 | if ( !crashing ) | 56 | if ( !crashing ) |
57 | { | 57 | { |
58 | // Draw Player | 58 | // Draw Player |
59 | // ellipseRGBA( screen, pos.x(), pos.y(), pos.x()+ pos.width(), pos.y()+pos.height(), 0, 255, 255, 255 ); | 59 | // ellipseRGBA( screen, pos.x(), pos.y(), pos.x()+ pos.width(), pos.y()+pos.height(), 0, 255, 255, 255 ); |
60 | filledEllipseRGBA( screen, pos.x() + pos.w(), pos.y(), pos.w(), pos.h(), 0, 255, 255, 255 ); | 60 | filledEllipseRGBA( screen, pos.x() + pos.w(), pos.y(), pos.w(), pos.h(), 0, 255, 255, 255 ); |