Commits

André Schnabel committed 3ce34cb Draft

Initial import

  • Participants

Comments (0)

Files changed (271)

File data/fonts/font.ttf

Binary file added.

File data/images/backgrounds/background1.jpg

Added
New image

File data/images/backgrounds/background2.jpg

Added
New image

File data/images/backgrounds/background3.jpg

Added
New image

File data/images/backgrounds/background4.jpg

Added
New image

File data/images/bullet.bmp

Added
New image

File data/images/credits/dogs.bmp

Added
New image

File data/images/credits/me.bmp

Added
New image

File data/images/editor/enemy_mode.bmp

Added
New image

File data/images/editor/item_mode.bmp

Added
New image

File data/images/editor/selected_tile.bmp

Added
New image

File data/images/editor/tile_mode.bmp

Added
New image

File data/images/enemies/blob/base.bmp

Added
New image

File data/images/enemies/blob/dead_left.bmp

Added
New image

File data/images/enemies/blob/dead_right.bmp

Added
New image

File data/images/enemies/blob/jumping_left.bmp

Added
New image

File data/images/enemies/blob/jumping_right.bmp

Added
New image

File data/images/enemies/blob/standing_left.bmp

Added
New image

File data/images/enemies/blob/standing_right.bmp

Added
New image

File data/images/enemies/blob/walking_left.bmp

Added
New image

File data/images/enemies/blob/walking_right.bmp

Added
New image

File data/images/enemies/plant/base.bmp

Added
New image

File data/images/enemies/plant/dead_left.bmp

Added
New image

File data/images/enemies/plant/dead_right.bmp

Added
New image

File data/images/enemies/plant/jumping_left.bmp

Added
New image

File data/images/enemies/plant/jumping_right.bmp

Added
New image

File data/images/enemies/plant/standing_left.bmp

Added
New image

File data/images/enemies/plant/standing_right.bmp

Added
New image

File data/images/enemies/plant/walking_left.bmp

Added
New image

File data/images/enemies/plant/walking_right.bmp

Added
New image

File data/images/enemies/robot/base.bmp

Added
New image

File data/images/enemies/robot/dead_left.bmp

Added
New image

File data/images/enemies/robot/dead_right.bmp

Added
New image

File data/images/enemies/robot/jumping_left.bmp

Added
New image

File data/images/enemies/robot/jumping_right.bmp

Added
New image

File data/images/enemies/robot/standing_left.bmp

Added
New image

File data/images/enemies/robot/standing_right.bmp

Added
New image

File data/images/enemies/robot/walking_left.bmp

Added
New image

File data/images/enemies/robot/walking_right.bmp

Added
New image

File data/images/enemies/rocketball/base.bmp

Added
New image

File data/images/enemies/rocketball/dead_left.bmp

Added
New image

File data/images/enemies/rocketball/dead_right.bmp

Added
New image

File data/images/enemies/rocketball/jumping_left.bmp

Added
New image

File data/images/enemies/rocketball/jumping_right.bmp

Added
New image

File data/images/enemies/rocketball/standing_left.bmp

Added
New image

File data/images/enemies/rocketball/standing_right.bmp

Added
New image

File data/images/enemies/rocketball/walking_left.bmp

Added
New image

File data/images/enemies/rocketball/walking_right.bmp

Added
New image

File data/images/enemies/snail/base.bmp

Added
New image

File data/images/enemies/snail/dead_left.bmp

Added
New image

File data/images/enemies/snail/dead_right.bmp

Added
New image

File data/images/enemies/snail/jumping_left.bmp

Added
New image

File data/images/enemies/snail/jumping_right.bmp

Added
New image

File data/images/enemies/snail/standing_left.bmp

Added
New image

File data/images/enemies/snail/standing_right.bmp

Added
New image

File data/images/enemies/snail/walking_left.bmp

Added
New image

File data/images/enemies/snail/walking_right.bmp

Added
New image

File data/images/enemies/stoney/base.bmp

Added
New image

File data/images/enemies/stoney/dead_left.bmp

Added
New image

File data/images/enemies/stoney/dead_right.bmp

Added
New image

File data/images/enemies/stoney/jumping_left.bmp

Added
New image

File data/images/enemies/stoney/jumping_right.bmp

Added
New image

File data/images/enemies/stoney/standing_left.bmp

Added
New image

File data/images/enemies/stoney/standing_right.bmp

Added
New image

File data/images/enemies/stoney/walking_left.bmp

Added
New image

File data/images/enemies/stoney/walking_right.bmp

Added
New image

File data/images/gun_left.bmp

Added
New image

File data/images/gun_right.bmp

Added
New image

File data/images/items/bullets.bmp

Added
New image

File data/images/items/burger.bmp

Added
New image

File data/images/items/c_book.bmp

Added
New image

File data/images/items/cpp_book.bmp

Added
New image

File data/images/items/drink.bmp

Added
New image

File data/images/items/fish.bmp

Added
New image

File data/images/items/hotdog.bmp

Added
New image

File data/images/items/live.bmp

Added
New image

File data/images/items/nin_cd.bmp

Added
New image

File data/images/items/sdl_book.bmp

Added
New image

File data/images/load/background.bmp

Added
New image

File data/images/load/circle.bmp

Added
New image

File data/images/menu/head.bmp

Added
New image

File data/images/menu/menu.bmp

Added
New image

File data/images/menu/settings/menu.bmp

Added
New image

File data/images/player1/base.bmp

Added
New image

File data/images/player1/dead_left.bmp

Added
New image

File data/images/player1/dead_right.bmp

Added
New image

File data/images/player1/jumping_left.bmp

Added
New image

File data/images/player1/jumping_right.bmp

Added
New image

File data/images/player1/standing_left.bmp

Added
New image

File data/images/player1/standing_right.bmp

Added
New image

File data/images/player1/walking_left.bmp

Added
New image

File data/images/player1/walking_right.bmp

Added
New image

File data/images/player2/base.bmp

Added
New image

File data/images/player2/dead_left.bmp

Added
New image

File data/images/player2/dead_right.bmp

Added
New image

File data/images/player2/jumping_left.bmp

Added
New image

File data/images/player2/jumping_right.bmp

Added
New image

File data/images/player2/standing_left.bmp

Added
New image

File data/images/player2/standing_right.bmp

Added
New image

File data/images/player2/walking_left.bmp

Added
New image

File data/images/player2/walking_right.bmp

Added
New image

File data/images/player3/base.bmp

Added
New image

File data/images/player3/dead_left.bmp

Added
New image

File data/images/player3/dead_right.bmp

Added
New image

File data/images/player3/jumping_left.bmp

Added
New image

File data/images/player3/jumping_right.bmp

Added
New image

File data/images/player3/standing_left.bmp

Added
New image

File data/images/player3/standing_right.bmp

Added
New image

File data/images/player3/walking_left.bmp

Added
New image

File data/images/player3/walking_right.bmp

Added
New image

File data/images/player4/base.bmp

Added
New image

File data/images/player4/dead_left.bmp

Added
New image

File data/images/player4/dead_right.bmp

Added
New image

File data/images/player4/jumping_left.bmp

Added
New image

File data/images/player4/jumping_right.bmp

Added
New image

File data/images/player4/standing_left.bmp

Added
New image

File data/images/player4/standing_right.bmp

Added
New image

File data/images/player4/walking_left.bmp

Added
New image

File data/images/player4/walking_right.bmp

Added
New image

File data/images/splash.jpg

Added
New image

File data/images/tiles/box_blue.bmp

Added
New image

File data/images/tiles/box_green.bmp

Added
New image

File data/images/tiles/box_orange.bmp

Added
New image

File data/images/tiles/box_red.bmp

Added
New image

File data/images/tiles/brown_stone.bmp

Added
New image

File data/images/tiles/end.bmp

Added
New image

File data/images/tiles/end_visible.bmp

Added
New image

File data/images/tiles/gradient_blue.bmp

Added
New image

File data/images/tiles/gradient_green.bmp

Added
New image

File data/images/tiles/gradient_red.bmp

Added
New image

File data/images/tiles/grass1.bmp

Added
New image

File data/images/tiles/grass2.bmp

Added
New image

File data/images/tiles/grass3.bmp

Added
New image

File data/images/tiles/gray.bmp

Added
New image

File data/images/tiles/ground.bmp

Added
New image

File data/images/tiles/ice.bmp

Added
New image

File data/images/tiles/nin.bmp

Added
New image

File data/images/tiles/platform1.bmp

Added
New image

File data/images/tiles/platform2.bmp

Added
New image

File data/images/tiles/platform3.bmp

Added
New image

File data/images/tiles/snow1.bmp

Added
New image

File data/images/tiles/snow2.bmp

Added
New image

File data/images/tiles/snow3.bmp

Added
New image

File data/images/tiles/start.bmp

Added
New image

File data/images/worldmap/levels/done.bmp

Added
New image

File data/images/worldmap/levels/level1.bmp

Added
New image

File data/images/worldmap/levels/level2.bmp

Added
New image

File data/images/worldmap/levels/level3.bmp

Added
New image

File data/images/worldmap/levels/level4.bmp

Added
New image

File data/images/worldmap/player/standing/0.bmp

Added
New image

File data/images/worldmap/player/standing/135.bmp

Added
New image

File data/images/worldmap/player/standing/180.bmp

Added
New image

File data/images/worldmap/player/standing/225.bmp

Added
New image

File data/images/worldmap/player/standing/270.bmp

Added
New image

File data/images/worldmap/player/standing/315.bmp

Added
New image

File data/images/worldmap/player/standing/45.bmp

Added
New image

File data/images/worldmap/player/standing/90.bmp

Added
New image

File data/images/worldmap/player/walking/0.bmp

Added
New image

File data/images/worldmap/player/walking/135.bmp

Added
New image

File data/images/worldmap/player/walking/180.bmp

Added
New image

File data/images/worldmap/player/walking/225.bmp

Added
New image

File data/images/worldmap/player/walking/270.bmp

Added
New image

File data/images/worldmap/player/walking/315.bmp

Added
New image

File data/images/worldmap/player/walking/45.bmp

Added
New image

File data/images/worldmap/player/walking/90.bmp

Added
New image

File data/images/worldmap/world.jpg

Added
New image

File data/levels/duel/level1.ctux

Binary file added.

File data/levels/level1.ctux

Binary file added.

File data/levels/level2.ctux

Binary file added.

File data/levels/level3.ctux

Binary file added.

File data/levels/level4.ctux

Binary file added.

File data/levels/start.ctux

Binary file added.

File data/music/strange.ogg

Binary file added.

File data/music/techi.ogg

Binary file added.

File data/sounds/change_selection.wav

Binary file added.

File data/sounds/enemy_dead.wav

Binary file added.

File data/sounds/gameover.wav

Binary file added.

File data/sounds/player_bump.wav

Binary file added.

File data/sounds/player_dying.wav

Binary file added.

File data/sounds/player_item_collected.wav

Binary file added.

File data/sounds/player_jump.wav

Binary file added.

File data/sounds/player_killing.wav

Binary file added.

File data/sounds/player_level_done.wav

Binary file added.

File data/sounds/player_shooting.wav

Binary file added.

File data/sounds/player_walking.wav

Binary file added.

File data/sounds/splash_sound.wav

Binary file added.

File doc/Readme.txt

+/*******************************************************************************
+
+    CommanderTux
+    Penguin In Space
+
+    Released under the GNU Public License    
+    2005 by Andr� Schnabel (thefrogs@web.de)
+
+*******************************************************************************/
+
+// Readme.txt
+
+Version 0.3
+
+Everything tested under Dev-C++ 4.9.9.2 with Mingw compiler, VS6, VS7, VS8 and Intel C++ Compiler.
+Should be working with gc++ and SDL, SDL_image, SDL_mixer and SDL_ttf libraries under Linux.
+
+Type --help for informations about the command line parameters!
+
+You can report bugs and other stuff relating to my email adress, which stands above.
+
+Anyway thank you for playing CommanderTux!
+
+Controls:
+    Walking left, right - left, right
+    Jump                - up
+    Shoot		- space
+
+==============
+Infos for duel
+==============
+
+Controls:
+    
+    Player 1    
+    Walking left, right - left, right
+    Jump                - up
+    
+    Player 2    
+    Walking left, right - a, d
+    Jump                - w
+    
+    Player 3    
+    Walking left, right - f, h
+    Jump                - t
+    
+    Player 4    
+    Walking left, right - j, l
+    Jump                - i
+
+To activate or deactive player 2-4 you can press the number of the player you want
+to activate or deactivate on your keyboard!
+
+TODO: Better launcher with WinAPI, more monsters, levels, optimization,
+joystick, gamepad, bugfixes, network support for cooperative game mode...

File src/Actor.cpp

+/*******************************************************************************
+
+    CommanderTux
+    Penguin In Space
+
+    Released under the GNU Public License    
+    2005 by Andr� Schnabel (thefrogs@web.de)
+
+*******************************************************************************/
+
+// Actor.cpp
+// For both player and enemies
+// Based upon the CSprite class
+
+#include "Actor.h"
+
+//
+// CActor
+// Constructor
+//
+CActor::CActor( int s_x, int s_y, SLevel *level,
+                SDL_Surface *images[NUM_ACTOR_IMAGES], int fall_speed )
+: CSprite( NULL )
+{
+    int i;
+    
+    // Init vars
+    m_level = level;
+    m_s_x = s_x;
+    m_s_y = s_y;
+    m_fall_speed = fall_speed;
+    
+    // Load all images
+    for( i=0; i<NUM_ACTOR_IMAGES; i++ )
+        m_images[i] = images[i];
+    
+    // Setup the rectangle
+    m_rect.w = TILE_W;
+    m_rect.h = TILE_H;
+    
+    SetPos( m_s_x, m_s_y );
+    
+    // Normally the actor stands
+    SetImage( m_images[STANDING_RIGHT] );
+    
+    // Some var initializing    
+    m_flip = true;
+    m_fall.active = m_jump.active = false;
+    m_dir = DIR_RIGHT;
+    m_standing = false;
+    m_reset_image = false;
+    m_jump_increase = 0;
+    
+    m_dying = false;
+}
+
+//
+// GetDying
+//
+bool CActor::GetDying()
+{
+    return m_dying;
+}
+
+//
+// Die
+//
+void CActor::Die()
+{
+    if( !m_dying ) // Prevent from dying more than once
+    {
+        m_dying = true;
+        
+        // Set suitable dying image
+        if( m_dir == DIR_RIGHT )        
+            SetImage( m_images[DEAD_RIGHT] );
+        else
+            SetImage( m_images[DEAD_LEFT] );
+    }
+}
+
+//
+// Respawn
+//
+void CActor::Respawn()
+{
+    // Only respawn when dying
+    if( m_dying )
+    {
+        SetImage(m_images[STANDING_RIGHT] );
+        m_dying = false;
+        // Get back to old start position
+        m_rect.y = m_s_y;
+        m_rect.x = m_s_x;
+    }
+}
+
+//
+// Walk
+//
+void CActor::Walk( Direction dir, int walk_speed )
+{
+    int i;
+    
+    // Dead actors can't walk
+    if( !m_dying )
+    {
+        // We're not standing anymore
+        m_standing = false;
+    
+        // Update image to current direction if neccessary
+        if( !m_jump.active && !m_fall.active )
+        {
+            // Walk left
+            if( dir == DIR_LEFT )
+            {
+                // Flip the image after a specific time
+                if( g_framework->GetTicks() - m_last_flip > FLIP_TIME )
+                {
+                    // Flip from false to true
+                    // Standing left image to walking left image
+                    if( !m_flip )
+                    {
+                        SetImage( m_images[WALKING_LEFT] );
+                        m_flip = true;
+                        
+                    }
+                    // Flip from true to false
+                    // Walking left image to standing left image
+                    else
+                    {
+                        SetImage( m_images[STANDING_LEFT] );
+                        m_flip = false;
+                    }
+                    
+                    // Refresh the time
+                    m_last_flip = g_framework->GetTicks();
+                }
+            }
+            // Walk right
+            else
+            {
+                // Flip the image after a specific time
+                if( g_framework->GetTicks() - m_last_flip > FLIP_TIME )
+                {
+                    // Flip from false to true
+                    // Standing right image to walking right image
+                    if( !m_flip )
+                    {
+                        SetImage( m_images[WALKING_RIGHT] );
+                        m_flip = true;
+                        
+                    }
+                    // Flip from true to false
+                    // Walking right image to standing right image
+                    else
+                    {
+                        SetImage( m_images[STANDING_RIGHT] );
+                        m_flip = false;
+                    }
+                    
+                    // Refresh the time
+                    m_last_flip = g_framework->GetTicks();
+                }
+            }
+        
+        }
+        else
+        {
+            // Direction changed?
+            if( m_dir != dir )
+            {
+                // Update jump image
+                if( dir == DIR_LEFT )
+                    SetImage( m_images[JUMPING_LEFT] );
+                else
+                    SetImage( m_images[JUMPING_RIGHT] );
+            }
+        }
+    
+        // Walk if possible
+        for( i=0; i<walk_speed; i++ )
+        {
+            // Approximate
+            if( dir == DIR_RIGHT )
+            {
+                if( WalkPossible( dir ) )
+                    m_rect.x++;
+                else
+                    break;
+            }
+            else
+            {
+                if( WalkPossible( dir ) )
+                    m_rect.x--;
+                else
+                    break;
+            }
+        }
+        
+        // Copy to member var
+        m_dir = dir;
+    
+    } // !m_dying
+}
+
+//
+// WalkPossible
+// Check whether walking is possible
+//
+// At all 2 Tiles can be beside the player
+// The player can walk when both of them are empty
+//
+bool CActor::WalkPossible( Direction dir )
+{
+    // Can the actor walk right?    
+    if( dir == DIR_RIGHT )
+    {
+        if( m_level->content[m_rect.y/TILE_H]
+                            [(m_rect.x+m_rect.w+1)/TILE_W]
+            == TILE_EMPTY &&
+            m_level->content[(m_rect.y+m_rect.h-1)/TILE_H]
+                            [(m_rect.x+m_rect.w+1)/TILE_W]
+            == TILE_EMPTY &&
+            m_rect.x + m_rect.w < LVL_W_MAX * TILE_W )
+            return true; // Walking right possible
+    }
+    else // Or left?
+    {
+        if( m_level->content[m_rect.y/TILE_H]
+                            [(m_rect.x-1)/TILE_W]
+            == TILE_EMPTY &&
+            m_level->content[(m_rect.y+m_rect.h-1)/TILE_H]
+                            [(m_rect.x-1)/TILE_W]
+            == TILE_EMPTY &&
+            m_rect.x > 0 )
+            return true; // Walking left possible
+    }
+    
+    // Walking not possible
+    return false;
+}
+
+//
+// Jump
+//
+void CActor::Jump()
+{
+    // Only jump when not falling or jumping yet
+    if( !m_jump.active && !m_fall.active && !m_dying )
+    {
+        // Set all values for a new jump
+        // Collisions stuff is all handled in the Update() func!
+        // Since we are not in UT 2004 actors can't start jumping in the air...
+        {
+            m_jump.active = true;
+            
+            // Refresh time
+            m_jump.s_time = g_framework->GetTicks();
+            
+            // Set correct image
+            if( m_dir == DIR_RIGHT )
+                SetImage( m_images[JUMPING_RIGHT] );
+            else
+                SetImage( m_images[JUMPING_LEFT] );
+        }
+    }
+}
+
+//
+// StopJump
+//
+void CActor::StopJump( bool bump )
+{
+    // Can't stop when not actually jumping
+    if( m_jump.active )
+    {
+        // Reset vars
+        m_jump.active = false;
+        m_reset_image = false;
+        m_jump_increase = 0;
+    }
+}
+
+//
+// IncreaseJump
+// So holding the jump key longer increases the jump
+//
+void CActor::IncreaseJump( bool ignore_max )
+{
+    // Only increase up to a specific value except ignore max is true
+    if( m_jump.active )
+    {
+        if( m_jump_increase < JUMP_INCREASE_MAX ||
+            ignore_max )
+            m_jump_increase+=JUMP_INCREASE_POWER;
+    }
+}
+
+//
+// Update
+//
+void CActor::Update( int *scroll_x, int *scroll_y, bool enemy )
+{
+    unsigned int i;
+    
+    // Don't update dying actors in most cases
+    if( !m_dying )
+    {    
+        // Jumping
+        // As when walking you need to consider that at most two tiles
+        // are near the actor
+        if( m_jump.active )
+        {
+            // Not standing anymore
+            m_standing = false;
+                
+            // Prevent from negative values and wrong numbers!
+            if( ( (g_framework->GetTicks()-m_jump.s_time) / 20 ) < JUMP_POWER + m_jump_increase )
+            {
+                // Don't jump inside of the tiles above
+                // Approximation
+                for( i=0;
+                    i<(JUMP_POWER+m_jump_increase)-((g_framework->GetTicks()-m_jump.s_time)/20);
+                    i++ )
+                {
+                    // Jump possible
+                    if( m_level->content[(m_rect.y-1)/TILE_H]
+                                        [(m_rect.x+1)/TILE_W]
+                        == TILE_EMPTY &&
+                        m_level->content[(m_rect.y-1)/TILE_H]
+                                        [(m_rect.x+m_rect.w-1)/TILE_W]
+                        == TILE_EMPTY )
+                    {
+                        m_rect.y--;
+                    }
+                    // Bump against the roof
+                    else
+                    {
+                        StopJump( true );                        
+                        break;
+                    }
+                }            
+            }
+            // Jump power is exceeded, the end is reached
+            else
+                StopJump( false );
+        }
+        
+        // Not jumping anymore... reset image!
+        if( m_standing )
+        {
+            m_reset_image = true;
+            // Once is enough!
+            m_standing = false;
+        }
+        
+        // Look whether the actor needs to fall
+        if( !m_jump.active && !m_fall.active )
+        {
+            // Is the tile under us empty?
+            if( m_level->content[(m_rect.y+m_rect.h+OVER)/TILE_H]
+                                [(m_rect.x+1)/TILE_W]
+                == TILE_EMPTY &&
+                m_level->content[(m_rect.y+m_rect.h+OVER)/TILE_H]
+                                [(m_rect.x+m_rect.w-1)/TILE_W]
+                == TILE_EMPTY )
+            {                
+                m_fall.active = true;
+                m_fall.s_time = g_framework->GetTicks();
+                    
+                // Set to the correct image
+                if( m_dir == DIR_LEFT )
+                    SetImage( m_images[JUMPING_LEFT] );
+                else
+                    SetImage( m_images[JUMPING_RIGHT] );
+            }
+        }
+        
+        // Reset image after falling or something
+        if( m_reset_image )
+        {
+            // Only if not falling
+            if( !m_fall.active )
+            {
+                // Make tux only look jumping when he really is!
+                if( m_dir == DIR_LEFT )
+                    SetImage( m_images[STANDING_LEFT] );
+                else
+                    SetImage( m_images[STANDING_RIGHT] );
+            }
+                
+            m_reset_image = false;
+        }
+        
+    } // !m_dying
+    
+    // Falling    
+    if( m_fall.active && !m_jump.active )
+    {
+        // Enemies still fall when dead
+        if( !m_dying || enemy )
+        {
+            // Approximation
+            for( i=0;
+                i<m_fall_speed+( (g_framework->GetTicks() - m_fall.s_time) / 100 );
+                i++ )
+            {
+                // Is the tile under us empty?
+                if( m_level->content[(m_rect.y+m_rect.h+OVER)/TILE_H]
+                                    [(m_rect.x+1)/TILE_W]
+                    == TILE_EMPTY &&
+                    m_level->content[(m_rect.y+m_rect.h+OVER)/TILE_H]
+                                        [(m_rect.x+m_rect.w-1)/TILE_W]
+                    == TILE_EMPTY &&
+                    m_rect.y + m_rect.h < LVL_H_MAX * TILE_H )
+                {
+                    m_rect.y++;                    
+                }
+                // Actor is falling out of the level
+                else if( m_rect.y + m_rect.h >= LVL_H_MAX * TILE_H )
+                {
+                    // Dying...
+                    Die();
+                }
+                // Actor bumps into the ground
+                else
+                {
+                    // Stopping the fall
+                    m_fall.active = false;
+                    m_reset_image = true;
+                    break;
+                }
+            } 
+        }
+    }
+}
+/*******************************************************************************
+
+    CommanderTux
+    Penguin In Space
+
+    Released under the GNU Public License    
+    2005 by Andr� Schnabel (thefrogs@web.de)
+
+*******************************************************************************/
+
+// Actor.h
+
+#ifndef ACTOR_H
+#define ACTOR_H
+
+#include "Sprite.h"
+#include "SLevel.h"
+
+// Anything concerning to the level should derive from this class
+class CActor : public CSprite
+{    
+    public:
+        CActor( int s_x, int s_y,
+				SLevel *level,
+                SDL_Surface *images[NUM_ACTOR_IMAGES],
+				int fall_speed );
+        
+        bool GetDying();
+        virtual void Die();
+        virtual void Respawn();
+        
+        virtual void Walk(  Direction dir=DIR_LEFT, int walk_speed = WALK_SPEED );
+        bool WalkPossible( Direction dir );
+        
+        virtual void Jump();       
+        virtual void StopJump( bool bump );
+        void IncreaseJump( bool ignore_max = false );
+        
+        virtual void Update( int *scroll_x, int *scroll_y, bool enemy );
+        
+        bool GetFalling() { return m_fall.active; }
+        void SetFalling( bool value ) { m_fall.active = value; }
+        
+        bool GetStanding() { return m_standing; }
+        void SetStanding( bool value ) { m_standing = value; }
+        
+        void SetDirection( Direction dir ) { m_dir = dir; }
+        Direction GetDirection() { return m_dir; }
+        
+        bool IsJumping() { return m_jump.active; }
+        
+    protected:
+        int m_s_x, m_s_y;
+        
+        SDL_Surface *m_images[NUM_ACTOR_IMAGES];
+        
+        Direction m_dir;
+        SLevel *m_level;
+        
+        bool m_flip;
+        Uint32 m_last_flip;
+        
+        int m_fall_speed;
+        Gravity_Event m_jump, m_fall;
+        unsigned int m_jump_increase;
+        bool m_reset_image;
+        bool m_standing, m_dying;
+};
+
+#endif

File src/Bullet.h

+/*******************************************************************************
+
+    CommanderTux
+    Penguin In Space
+
+    Released under the GNU Public License    
+    2005 by Andr� Schnabel (thefrogs@web.de)
+
+*******************************************************************************/
+
+// Bullet.h
+
+#ifndef BULLET_H
+#define BULLET_H
+
+#include "Framework.h"
+#include "Sprite.h"
+#include "SLevel.h"
+#include "Enemy.h"
+
+class CBullet : public CSprite
+{
+    public:
+        CBullet(	SDL_Surface *surf,
+					int x, int y, int speed,
+					Direction dir, SLevel *level,
+					CLinkedList< CEnemy > *enemies )
+        {
+			SetImage( surf );
+
+            m_speed = speed;
+            m_dir = dir;
+            m_level = level;
+            m_enemies = enemies;
+            m_victim = NULL,
+            m_killed_enemy = false;
+            
+            m_rect.x = x;
+            m_rect.y = y;
+            m_rect.w = surf->w;
+            m_rect.h = surf->h;
+        }
+        
+        // Returns false if this bullet must be deleted
+        bool Update( int *scroll_x, int *scroll_y )
+        {
+            int i, j;
+            
+            // Approximation
+            for( i=0; i<m_speed; i++ )
+            {
+                // Fly left
+                if( m_dir == DIR_LEFT )
+                {
+                    if( m_rect.x-1 > 0 )
+                        m_rect.x-=1;
+                }
+                // Fly right
+                else
+                {
+                    if( m_rect.x+1 < LVL_W_MAX * TILE_W )
+                        m_rect.x+=1;
+                }
+                
+                // Collision with tile?
+                if( m_level->content[m_rect.y/TILE_H][m_rect.x/TILE_W] != TILE_EMPTY )
+                    return false;
+                
+                // Collision with enemy
+                for( j=0; j<m_enemies->GetNumberOfElements(); j++ )
+                {
+                    if( g_framework->Coll( m_enemies->GetData( j )->GetRect(), &m_rect ) )
+                    {
+                        if( !m_enemies->GetData( j )->GetDying() && m_enemies->GetData( j )->IsShootable() )
+                        {
+                            m_enemies->GetData( j )->Die();
+                            m_killed_enemy = true;
+                            m_victim = m_enemies->GetData( j );
+                            return false;
+                        }
+                    }
+                }
+            }
+            return true;
+        }
+        
+        bool EnemyKilled() { return m_killed_enemy; }
+        CEnemy *GetVictim() { return m_victim; }
+        
+    private:
+        bool m_killed_enemy;
+        CEnemy *m_victim;
+        Direction m_dir;
+        int m_speed;
+        SLevel *m_level;
+        CLinkedList< CEnemy > *m_enemies;
+};
+
+#endif

File src/CommanderTux.cpp

+/*******************************************************************************
+
+    CommanderTux
+    Penguin In Space
+
+    Released under the GNU Public License    
+    2005 by Andr� Schnabel (thefrogs@web.de)
+
+*******************************************************************************/
+
+// See Readme.txt for more informations!
+
+// CommanderTux.cpp
+// Main project file
+
+#include "Framework.h"
+#include "Level.h"
+#include "Splash.h"
+#include "Game.h"
+#include "Editor.h"
+#include "Duel.h"
+
+//
+// main
+// Entrypoint
+//
+int main( int argc, char *argv[] )
+{    
+    bool stop; // for --help
+    bool done = false;
+
+    // Setup structure
+    SFramework_Setup setup;
+    
+    // States
+    CSplash *splash;    
+    CGame *game;
+    CDuel *duel;
+    CEditor *editor;
+    
+    // Cmd line stuff
+    setup = ParseArgs( argc, argv, &stop );
+    if( stop )
+        return 0;
+    
+    // Default msgs
+    DEBUG( "== CommanderTux ==" );    
+    DEBUG( "== Starting... ==" );
+    SHOW_VERSION();
+    DEBUG( "http://commandertux.sourceforge.net" );
+      
+    setup.caption = "CommanderTux";
+    
+    // Init framework
+    new CFramework( &setup );
+    
+    // The splash state is not in the loop of states
+    // Because it is only shown once the game is started!
+    splash = new CSplash();    
+    if( !splash->Loop() ) // If fast exit
+    {
+        delete splash;
+        delete g_framework;
+        return 0;
+    }
+    delete splash;
+    
+    // Main loop between the states
+    while( !done )
+    {
+        // Start the different game states
+        if( !setup.editor && !setup.duel ) // Normal mode
+        {            
+            game = new CGame( &setup );
+            if( !game->Loop() ) // If fast exit
+            {
+                delete game;
+                delete g_framework;
+                return 0;
+            }
+            done = game->GetAllDone();
+            delete game;
+        }
+        
+        if( setup.duel ) // Duel mode
+        {
+            duel = new CDuel();
+            if( !duel->Loop() ) // If fast exit
+            {
+                delete duel;
+                delete g_framework;
+                return 0;
+            }
+            delete duel;
+            setup.duel = false;
+        }
+        
+        if( setup.editor ) // Leveleditor
+        {            
+            editor = new CEditor();
+            if( !editor->Loop() ) // If fast exit
+            {
+                delete editor;
+                delete g_framework;
+                return 0;
+            }
+            delete editor;
+            setup.editor = false;
+        }
+    }
+
+    // Shutdown framework
+    delete g_framework;
+    
+    DEBUG( "== Shutdown ==" );
+    return 0;
+}

File src/CommanderTux.dev

+[Project]
+FileName=CommanderTux.dev
+Name=CommanderTux
+UnitCount=34
+Type=0
+Ver=1
+ObjFiles=
+Includes=
+Libs=
+PrivateResource=CommanderTux_private.rc
+ResourceIncludes=
+MakeIncludes=
+Compiler=-Dmain=SDL_main_@@_
+CppCompiler=
+Linker=-lmingw32_@@_-lSDLmain -lSDL_@@_-lSDL_image_@@_-lSDL_ttf_@@_-lSDL_mixer_@@_
+IsCpp=1
+Icon=CommanderTux.ico
+ExeOutput=..\bin
+ObjectOutput=obj
+OverrideOutput=0
+OverrideOutputName=CommanderTux.exe
+HostApplication=
+Folders=Actors,Common,Doc,States
+CommandLine=
+UseCustomMakefile=0
+CustomMakefile=
+IncludeVersionInfo=1
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=0000000000000000000000
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=0
+Build=0
+LanguageID=1033
+CharsetID=1252
+CompanyName=Andr� Schnabel
+FileVersion=0.1
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=GNU Public License
+LegalTrademarks=
+OriginalFilename=CommanderTux.exe
+ProductName=CommanderTux
+ProductVersion=0.1
+AutoIncBuildNr=0
+
+[Unit7]
+FileName=Level.h
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit10]
+FileName=State.h
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit12]
+FileName=Editor.cpp
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit13]
+FileName=Framework.cpp
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit14]
+FileName=Game.cpp
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit15]
+FileName=Level.cpp
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit16]
+FileName=Splash.cpp
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit1]
+FileName=Sprite.cpp
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit2]
+FileName=Defines.h
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit3]
+FileName=Editor.h
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit4]
+FileName=Enemy.h
+CompileCpp=1
+Folder=Actors
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit5]
+FileName=Framework.h
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit6]
+FileName=Game.h
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit8]
+FileName=Splash.h
+CompileCpp=1
+Folder=States
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit9]
+FileName=Sprite.h
+CompileCpp=1
+Folder=Common
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit11]
+FileName=CommanderTux.cpp
+CompileCpp=1
+Folder=