+++ /dev/null
-SUBDIRS = lib src data
-EXTRA_DIST = LEVELDESIGN TODO contrib/levelconverter-0.0.6_0.0.7.py autogen.sh
-ACLOCAL_AMFLAGS = -I mk/autoconf
-AUTOMAKE_OPTIONS = 1.6 dist-bzip2
few pixels higher) - hopefully ok
* it's impossible to go into passages that have exactly the size of tux,
either reduce collision rectangle by DELTA or round collision coordinates to
- integers...
+ integers... - ok for tux and most badguys
** implement 1up - ok
** implement star - ok
* bring back the enemies
- - add activation again
- - make api simpler
+ - add activation again - ok
+ - make api simpler - ok
- implement jumpy - ok
-* implement spiky - ok
- implement snowball - ok
for after big commit...
* smoke clouds are too fast
* some shots disappear in the ground with a "max collision depth reached"
- message
+ message - ok
* rework collision detection to take movement into account - this should fix
the egg suddenly turning directions and the somtimes strange behaviour
when hitting a block from the side when falling.
** having a star doesn't kill enemies - ok
* tux always jumps to full height at the moment - ok
* invisble blocks are visible and make the game crash when bumped - ok
- * reimplement spikes as objects
+ * reimplement spikes as objects - ok
* what to do when stuck under tiles (after using duck-sliding)
* do we want multi hit scores again?
* tux doesn't stop at igloo anymore
echo 'INSTALL ?= "@INSTALL@" ;' >> Jamconfig.in
echo 'JAMCONFIG_READ = yes ;' >> Jamconfig.in
-# we need a minimum of automake 1.6 and automake 1.8 seems to be buggy
-# this doesn't seem to work well
-# see AUTOMAKE_OPTIONS in Makefile.am
-export WANT_AUTOMAKE=1.6
-
-automake --copy --add-missing
autoconf
echo " Debug Mode: $enable_debug"
echo " OpenGL Support: $enable_opengl"
echo ""
+echo ""
+echo " NOTE: This project uses jam (and not make) as build tool"
+
;; Bad Guys follow
+ (sprite (name "spike")
+ (action
+ (name "north")
+ (images "tilesets/spike_up.png")
+ )
+ (action
+ (name "south")
+ (images "tilesets/spike_down.png")
+ )
+ (action
+ (name "west")
+ (images "tilesets/spike_left.png")
+ )
+ (action
+ (name "east")
+ (images "tilesets/spike_right.png")
+ )
+ )
;; MrIceBlock
(sprite (name "mriceblock")
+++ /dev/null
-INCLUDES =
-METASOURCES = AUTO
-lib_LTLIBRARIES = libsupertux.la
-libsupertux_la_SOURCES =app/globals.cpp \
- app/setup.cpp \
- audio/musicref.cpp \
- audio/sound_manager.cpp \
- gui/button.cpp \
- gui/menu.cpp \
- gui/mousecursor.cpp \
- math/physic.cpp \
- math/vector.cpp \
- special/game_object.cpp \
- special/moving_object.cpp \
- special/sprite.cpp \
- special/sprite.h \
- special/sprite_data.cpp \
- special/sprite_data.h \
- special/sprite_manager.cpp \
- special/sprite_manager.h \
- special/timer.cpp \
- special/frame_rate.cpp \
- special/collision.h \
- special/collision_hit.h \
- special/collision.cpp \
- utils/configfile.cpp \
- utils/lispreader.cpp \
- utils/lispwriter.cpp \
- video/drawing_context.cpp \
- video/font.cpp \
- video/screen.cpp \
- video/surface.cpp
-libsupertuxdir = $(includedir)/supertux
-libsupertuxappdir = $(libsupertuxdir)/app
-libsupertuxaudiodir = $(libsupertuxdir)/audio
-libsupertuxguidir = $(libsupertuxdir)/gui
-libsupertuxmathdir = $(libsupertuxdir)/math
-libsupertuxspecialdir = $(libsupertuxdir)/special
-libsupertuxutilsdir = $(libsupertuxdir)/utils
-libsupertuxvideodir = $(libsupertuxdir)/video
-libsupertuxapp_HEADERS =app/setup.h \
- app/gettext.h \
- app/globals.h
-libsupertuxaudio_HEADERS =audio/musicref.h \
- audio/sound_manager.h
-libsupertuxgui_HEADERS =gui/button.h \
- gui/menu.h \
- gui/mousecursor.h
-libsupertuxmath_HEADERS =math/physic.h \
- math/vector.h
-libsupertuxspecial_HEADERS = special/game_object.h \
- special/moving_object.h \
- special/sprite.h \
- special/sprite_manager.h \
- special/timer.h \
- special/frame_rate.h
-libsupertuxutils_HEADERS =utils/configfile.h \
- utils/exceptions.h \
- utils/lispreader.h \
- utils/lispwriter.h
-libsupertuxvideo_HEADERS =video/drawing_context.h \
- video/font.h \
- video/screen.h \
- video/surface.h
-libsupertux_la_LDFLAGS = -module
-
-
+++ /dev/null
-localedir = $(datadir)/locale
-
-bin_PROGRAMS = supertux
-supertux_CXXFLAGS = -DLOCALEDIR=\"$(localedir)\"
-supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@
-
-
-supertux_SOURCES = camera.cpp \
- camera.h collision.cpp collision.h intro.cpp intro.h \
- gameloop.cpp gameloop.h high_scores.cpp high_scores.h \
- level.cpp level.h level_subset.cpp level_subset.h \
- leveleditor.cpp leveleditor.h particlesystem.cpp \
- particlesystem.h player.cpp player.h scene.cpp \
- scene.h supertux.cpp title.cpp title.h worldmap.cpp \
- worldmap.h tile.h tile.cpp tile_manager.h tile_manager.cpp resources.h \
- resources.cpp gameobjs.h gameobjs.cpp background.h background.cpp tilemap.h \
- tilemap.cpp serializable.h sector.cpp sector.h misc.h misc.cpp defines.h \
- statistics.cpp badguy_specs.cpp \
- timer.cpp timer.h \
- object/coin.h object/coin.cpp \
- object/block.h object/block.cpp \
- object/platform.h object/platform.cpp \
- object/fireworks.h object/fireworks.cpp \
- object/bullet.h object/bullet.cpp \
- object/specialriser.h object/specialriser.cpp \
- object/star.h object/star.cpp \
- object/oneup.h object/oneup.cpp \
- object/flower.h object/flower.cpp \
- object/growup.h object/growup.cpp \
- object/invisible_block.h object/invisible_block.cpp \
- badguy/badguy.h badguy/badguy.cpp \
- badguy/bomb.h badguy/bomb.cpp \
- badguy/bouncing_snowball.h badguy/bouncing_snowball.cpp\
- badguy/flame.h badguy/flame.cpp \
- badguy/jumpy.h badguy/jumpy.cpp \
- badguy/mrbomb.h badguy/mrbomb.cpp \
- badguy/mriceblock.h badguy/mriceblock.cpp \
- badguy/snowball.h badguy/snowball.cpp \
- badguy/spiky.h badguy/spiky.cpp \
- trigger/trigger_base.h trigger/trigger_base.cpp \
- trigger/door.h trigger/door.cpp \
- trigger/sequence_trigger.h trigger/sequence_trigger.cpp
-
-INCLUDES = -I$(top_srcdir)/lib
if(state == STATE_INIT || state == STATE_INACTIVE)
return;
if(state == STATE_FALLING) {
- sprite->draw(context, get_pos(), LAYER_OBJECTS, VERTICAL_FLIP);
+ sprite->draw(context, get_pos(), LAYER_OBJECTS, VERTICAL_FLIP);
} else {
- sprite->draw(context, get_pos(), LAYER_OBJECTS);
+ sprite->draw(context, get_pos(), LAYER_OBJECTS);
}
}
{
start_position = pos;
bbox.set_pos(pos);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("bomb");
state = 0;
timer.start(TICKINGTIME);
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("bouncingsnowball");
}
{
start_position.x = pos_x;
start_position.y = pos_y;
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("bouncingsnowball");
}
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("jumpy");
}
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("mrbomb");
}
{
start_position.x = pos_x;
start_position.y = pos_y;
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("mrbomb");
}
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("mriceblock");
}
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("snowball");
}
{
start_position.x = pos_x;
start_position.y = pos_y;
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("snowball");
}
--- /dev/null
+#include "spike.h"
+
+Spike::Spike(const Vector& pos, Direction dir)
+{
+ sprite = sprite_manager->create("spike");
+ start_position = pos;
+ bbox.set_pos(Vector(0, 0));
+ bbox.set_size(32, 32);
+ set_direction(dir);
+}
+
+Spike::Spike(LispReader& reader)
+{
+ sprite = sprite_manager->create("spike");
+ reader.read_float("x", start_position.x);
+ reader.read_float("y", start_position.y);
+ bbox.set_size(32, 32);
+ int idir = 0;
+ reader.read_int("direction", idir);
+ set_direction((Direction) idir);
+}
+
+void
+Spike::set_direction(Direction dir)
+{
+ spikedir = dir;
+ switch(spikedir) {
+ case NORTH:
+ sprite->set_action("north");
+ break;
+ case SOUTH:
+ sprite->set_action("south");
+ break;
+ case WEST:
+ sprite->set_action("west");
+ break;
+ case EAST:
+ sprite->set_action("east");
+ break;
+ default:
+ break;
+ }
+}
+
+void
+Spike::write(LispWriter& writer)
+{
+ writer.start_list("spike");
+ writer.write_float("x", start_position.x);
+ writer.write_float("y", start_position.y);
+ writer.write_int("direction", spikedir);
+ writer.end_list("spike");
+}
+
+void
+Spike::kill_fall()
+{
+ // you can't kill a spike
+}
+
+void
+Spike::active_action(float )
+{
+}
--- /dev/null
+#ifndef __SPIKE_H__
+#define __SPIKE_H__
+
+#include "badguy.h"
+
+class Spike : public BadGuy
+{
+public:
+ enum Direction {
+ NORTH=0, SOUTH, WEST, EAST
+ };
+ Spike(const Vector& pos, Direction dir);
+ Spike(LispReader& reader);
+
+ void active_action(float elapsed_time);
+ void write(LispWriter& writer);
+ void kill_fall();
+private:
+ void set_direction(Direction dir);
+ Direction spikedir;
+};
+
+#endif
+
{
reader.read_float("x", start_position.x);
reader.read_float("y", start_position.y);
- bbox.set_size(32, 32);
+ bbox.set_size(31.8, 31.8);
sprite = sprite_manager->create("spiky");
}
+++ /dev/null
-/***************************************************************************
- badguy_specs.cpp - badguys properties table
- -------------------
- begin : Oct, 11 2004
- copyright : (C) 2004 by Ricardo Cruz
- email : rick2@aeiou.pt
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#include <config.h>
-
-#include <iostream>
-
-#include "special/sprite_manager.h"
-#include "resources.h"
-
-#include "badguy_specs.h"
-
-BadGuySpecsManager* badguyspecs_manager = 0;
-
-BadGuySpecsManager::BadGuySpecsManager(const std::string& filename)
-{
- load_resfile(filename);
-}
-
-BadGuySpecsManager::~BadGuySpecsManager()
-{
- for(std::map<std::string, BadGuySpecs*>::iterator i =
- badguys_specs.begin(); i != badguys_specs.end(); ++i)
- delete i->second;
-}
-
-void
-BadGuySpecsManager::load_resfile(const std::string& filename)
-{
- lisp_object_t* root_obj = lisp_read_from_file(filename);
- if (!root_obj)
- {
- std::cout << "BadGuySpecsManager: Couldn't load: " << filename << std::endl;
- return;
- }
-
- lisp_object_t* cur = root_obj;
-
- if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-badguys-specifications") != 0)
- return;
- cur = lisp_cdr(cur);
-
- while(cur)
- {
- lisp_object_t* el = lisp_car(cur);
-
- if (strcmp(lisp_symbol(lisp_car(el)), "badguy") == 0)
- {
- LispReader reader(lisp_cdr(lisp_car(cur)));
- BadGuySpecs* badguy_specs = new BadGuySpecs(reader);
-
- BadGuysSpecs::iterator i = badguys_specs.find(badguy_specs->get_name());
- if (i == badguys_specs.end())
- {
- badguys_specs[badguy_specs->get_name()] = badguy_specs;
- }
- else
- {
- delete i->second;
- i->second = badguy_specs;
- std::cerr << "Warning: dulpicate entry: '" << badguy_specs->get_name() << "'" << std::endl;
- }
- }
- else
- {
- std::cout << "BadGuySpecsManager: Unknown tag" << std::endl;
- }
-
- cur = lisp_cdr(cur);
- }
-
- lisp_free(root_obj);
-}
-
-BadGuySpecs*
-BadGuySpecsManager::load(const std::string& name)
-{
- BadGuysSpecs::iterator i = badguys_specs.find(name);
- if (i == badguys_specs.end())
- {
- std::cerr << "Warning: BadGuy specification '" << name << "' not found" << std::endl;
- return 0;
- }
- return i->second;
-}
-
-BadGuySpecs::BadGuySpecs(LispReader& reader)
-{
- reset();
-
- std::string str;
- reader.read_string("kind", str);
- kind = str;
-
- str.clear();
- reader.read_string("inherits", str);
- if(!str.empty())
- {
- BadGuySpecs* bgspecs = badguyspecs_manager->load(str);
- if(bgspecs)
- {
- sprite = bgspecs->sprite;
- }
- else
- std::cerr << "Warning: inherited '" << str
- << "was not found.\nProbably, it was declared after"
- "this entry '" << kind << std::endl;
- }
-
- str.clear();
- reader.read_string("sprite", str);
- if(str.empty())
- std::cerr << "Warning: No sprite has been set to badguy " << kind << std::endl;
- else
- sprite = sprite_manager->create(str);
-
- if(!sprite) {
- std::cerr << "Warning: Sprite '" << str << "' could not be loaded.\n";
- }
-}
-
-BadGuySpecs::BadGuySpecs(std::string& kind_)
-{
- reset();
- kind = kind_;
-}
-
-BadGuySpecs::~BadGuySpecs()
-{
- delete sprite;
-}
-
-void
-BadGuySpecs::reset()
-{
- kind.clear();
-}
-
-std::string
-BadGuySpecs::get_name()
-{
-return kind;
-}
-
-// EOF //
+++ /dev/null
-/***************************************************************************
- badguy_specs.h - badguys properties table
- -------------------
- begin : Oct, 11 2004
- copyright : (C) 2004 by Ricardo Cruz
- email : rick2@aeiou.pt
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-#ifndef SUPERTUX_BADGUY_SPECS_H
-#define SUPERTUX_BADGUY_SPECS_H
-
-#include <string>
-#include <map>
-
-#include "utils/lispreader.h"
-
-using namespace SuperTux;
-
-namespace SuperTux {
-class Sprite;
-}
-
-class BadGuySpecs;
-class BadGuySpecsManager;
-extern BadGuySpecsManager* badguyspecs_manager;
-
-class BadGuySpecsManager
-{
-public:
- BadGuySpecsManager(const std::string& filename);
- ~BadGuySpecsManager();
-
- void load_resfile(const std::string& filename);
- /** loads a sprite.
- * WARNING: You must not delete the returned object.
- */
- BadGuySpecs* load(const std::string& name);
-
-private:
- typedef std::map<std::string, BadGuySpecs*> BadGuysSpecs;
- BadGuysSpecs badguys_specs;
-};
-
-class BadGuySpecs
-{
-public:
- BadGuySpecs(LispReader& reader);
- BadGuySpecs(std::string& kind);
- ~BadGuySpecs();
-
- std::string get_name();
-
- // proprities
- std::string kind;
- Sprite* sprite;
-
-private:
- void reset();
-};
-
-
-#endif /*SUPERTUX_BADGUY_SPECS_H*/
physic.set_velocity_y(.1);
}
- if(fabsf(hit.normal.x) > .5) { // hit on the side?
- printf("s"); fflush(stdout);
+ if(fabsf(hit.normal.x) > .9) { // hit on the side?
physic.set_velocity_x(0);
}
#include "object/block.h"
#include "object/invisible_block.h"
#include "object/platform.h"
-#include "trigger/door.h"
#include "object/bullet.h"
#include "badguy/jumpy.h"
#include "badguy/snowball.h"
#include "badguy/mriceblock.h"
#include "badguy/mrbomb.h"
#include "badguy/dispenser.h"
+#include "badguy/spike.h"
+#include "trigger/door.h"
#include "trigger/sequence_trigger.h"
#include "trigger/secretarea_trigger.h"
}
GameObject*
-Sector::parseObject(const std::string& name, LispReader& reader)
+Sector::parse_object(const std::string& name, LispReader& reader)
{
if(name == "background") {
background = new Background(reader);
return new MrBomb(reader);
} else if(name == "dispenser") {
return new Dispenser(reader);
+ } else if(name == "spike") {
+ return new Spike(reader);
}
#if 0
else if(badguykind_from_string(name) != BAD_INVALID) {
reader.read_float("y", sp->pos.y);
spawnpoints.push_back(sp);
} else {
- GameObject* object = parseObject(token, reader);
+ GameObject* object = parse_object(token, reader);
if(object) {
add_object(object);
}
LispReader reader(lisp_cdr(data));
- GameObject* object = parseObject(object_type, reader);
+ GameObject* object = parse_object(object_type, reader);
if(object) {
add_object(object);
} else {
if(tile->id == 112) {
add_object(new InvisibleBlock(pos));
solids->change(x, y, 0);
+ } else if(tile->id == 295) {
+ add_object(new Spike(pos, Spike::NORTH));
+ solids->change(x, y, 0);
+ } else if(tile->id == 296) {
+ add_object(new Spike(pos, Spike::EAST));
+ solids->change(x, y, 0);
+ } else if(tile->id == 297) {
+ add_object(new Spike(pos, Spike::SOUTH));
+ solids->change(x, y, 0);
+ } else if(tile->id == 298) {
+ add_object(new Spike(pos, Spike::WEST));
+ solids->change(x, y, 0);
} else if(tile->attributes & Tile::COIN) {
add_object(new Coin(pos));
solids->change(x, y, 0);
void collision_object(MovingObject* object1, MovingObject* object2);
void load_music();
- GameObject* parseObject(const std::string& name, LispReader& reader);
+ GameObject* parse_object(const std::string& name, LispReader& reader);
static Sector* _current;