Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

ADD periodicTimer

  • Loading branch information...
commit 599190ddacedc8c4f97ca5abf0c26b17b066bb2b 1 parent 40d8368
@PowerKiKi authored
View
2  application/polukili.pnproj
@@ -1 +1 @@
-<Project name="PoLuKiLi"><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="source" path="source\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Bullets" path="Bullets\"><File path="Bullet.cpp"></File><File path="Bullet.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Ennemies" path="Ennemies\"><File path="Bee.cpp"></File><File path="Bee.h"></File><File path="Earthworm.cpp"></File><File path="Earthworm.h"></File><File path="Ennemy.cpp"></File><File path="Ennemy.h"></File><File path="EnnemyGenerator.cpp"></File><File path="EnnemyGenerator.h"></File><File path="Spider.cpp"></File><File path="Spider.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Items" path="Items\"><File path="Deodorant.cpp"></File><File path="Deodorant.h"></File><File path="Flyswater.cpp"></File><File path="Flyswater.h"></File><File path="Item.cpp"></File><File path="Item.h"></File><File path="Ligther.cpp"></File><File path="Ligther.h"></File><File path="Matches.cpp"></File><File path="Matches.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Pets" path="Pets\"><File path="Ladybird.cpp"></File><File path="Ladybird.h"></File><File path="Pet.cpp"></File><File path="Pet.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Players" path="Players\"><File path="Kiki.cpp"></File><File path="Kiki.h"></File><File path="Lila.cpp"></File><File path="Lila.h"></File><File path="Luna.cpp"></File><File path="Luna.h"></File><File path="Player.cpp"></File><File path="Player.h"></File><File path="Poupa.cpp"></File><File path="Poupa.h"></File></MagicFolder><File path="Actor.cpp"></File><File path="Actor.h"></File><File path="ActorAction.h"></File><File path="ActorState.h"></File><File path="BibScreenFont.cpp"></File><File path="BibScreenFont.h"></File><File path="CollisionCategories.h"></File><File path="Console.cpp"></File><File path="Console.h"></File><File path="Constants.cpp"></File><File path="Constants.h"></File><File path="Effect.cpp"></File><File path="Effect.h"></File><File path="Element.h"></File><File path="font_metrics.c"></File><File path="font_metrics.h"></File><File path="Game.cpp"></File><File path="Game.h"></File><File path="ImageLibrary.cpp"></File><File path="ImageLibrary.h"></File><File path="Level.cpp"></File><File path="Level.h"></File><File path="main.cpp"></File><File path="Rubbish.cpp"></File><File path="Rubbish.h"></File><File path="Timer.cpp"></File><File path="Timer.h"></File><File path="Warpzone.cpp"></File><File path="Warpzone.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="box2d" path="box2d\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Collision" path="Collision\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Shapes" path="Shapes\"><File path="b2CircleShape.h"></File><File path="b2EdgeShape.h"></File><File path="b2PolygonShape.h"></File><File path="b2Shape.h"></File></MagicFolder><File path="b2BroadPhase.h"></File><File path="b2Collision.h"></File><File path="b2Distance.h"></File><File path="b2DynamicTree.h"></File><File path="b2PairManager.h"></File><File path="b2TimeOfImpact.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Common" path="Common\"><File path="b2BlockAllocator.h"></File><File path="b2Math.h"></File><File path="b2Settings.h"></File><File path="b2StackAllocator.h"></File><File path="Fixed.h"></File><File path="jtypes.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Dynamics" path="Dynamics\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Contacts" path="Contacts\"><File path="b2CircleContact.h"></File><File path="b2Contact.h"></File><File path="b2ContactSolver.h"></File><File path="b2EdgeAndCircleContact.h"></File><File path="b2NullContact.h"></File><File path="b2PolyAndCircleContact.h"></File><File path="b2PolyAndEdgeContact.h"></File><File path="b2PolyContact.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Controllers" path="Controllers\"><File path="b2BuoyancyController.h"></File><File path="b2ConstantAccelController.h"></File><File path="b2ConstantForceController.h"></File><File path="b2Controller.h"></File><File path="b2GravityController.h"></File><File path="b2TensorDampingController.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Joints" path="Joints\"><File path="b2DistanceJoint.h"></File><File path="b2GearJoint.h"></File><File path="b2Joint.h"></File><File path="b2LineJoint.h"></File><File path="b2MouseJoint.h"></File><File path="b2PrismaticJoint.h"></File><File path="b2PulleyJoint.h"></File><File path="b2RevoluteJoint.h"></File></MagicFolder><File path="b2Body.h"></File><File path="b2ContactManager.h"></File><File path="b2EdgeChain.h"></File><File path="b2Fixture.h"></File><File path="b2Island.h"></File><File path="b2World.h"></File><File path="b2WorldCallbacks.h"></File></MagicFolder><File path="Box2D.h"></File></MagicFolder></MagicFolder><File path="Makefile"></File></Project>
+<Project name="PoLuKiLi"><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="source" path="source\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Bullets" path="Bullets\"><File path="Bullet.cpp"></File><File path="Bullet.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Ennemies" path="Ennemies\"><File path="Bee.cpp"></File><File path="Bee.h"></File><File path="Earthworm.cpp"></File><File path="Earthworm.h"></File><File path="Ennemy.cpp"></File><File path="Ennemy.h"></File><File path="EnnemyGenerator.cpp"></File><File path="EnnemyGenerator.h"></File><File path="Spider.cpp"></File><File path="Spider.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Items" path="Items\"><File path="Deodorant.cpp"></File><File path="Deodorant.h"></File><File path="Flyswater.cpp"></File><File path="Flyswater.h"></File><File path="Item.cpp"></File><File path="Item.h"></File><File path="Ligther.cpp"></File><File path="Ligther.h"></File><File path="Matches.cpp"></File><File path="Matches.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Pets" path="Pets\"><File path="Ladybird.cpp"></File><File path="Ladybird.h"></File><File path="Pet.cpp"></File><File path="Pet.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h;*.c;*.cpp" name="Players" path="Players\"><File path="Kiki.cpp"></File><File path="Kiki.h"></File><File path="Lila.cpp"></File><File path="Lila.h"></File><File path="Luna.cpp"></File><File path="Luna.h"></File><File path="Player.cpp"></File><File path="Player.h"></File><File path="Poupa.cpp"></File><File path="Poupa.h"></File></MagicFolder><File path="Actor.cpp"></File><File path="Actor.h"></File><File path="ActorAction.h"></File><File path="ActorState.h"></File><File path="BibScreenFont.cpp"></File><File path="BibScreenFont.h"></File><File path="CollisionCategories.h"></File><File path="Console.cpp"></File><File path="Console.h"></File><File path="Constants.cpp"></File><File path="Constants.h"></File><File path="ContactListener.cpp"></File><File path="ContactListener.h"></File><File path="Effect.cpp"></File><File path="Effect.h"></File><File path="Element.h"></File><File path="font_metrics.c"></File><File path="font_metrics.h"></File><File path="Game.cpp"></File><File path="Game.h"></File><File path="ImageLibrary.cpp"></File><File path="ImageLibrary.h"></File><File path="Level.cpp"></File><File path="Level.h"></File><File path="main.cpp"></File><File path="PeriodicTimer.cpp"></File><File path="PeriodicTimer.h"></File><File path="Rubbish.cpp"></File><File path="Rubbish.h"></File><File path="Timer.cpp"></File><File path="Timer.h"></File><File path="Warpzone.cpp"></File><File path="Warpzone.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="box2d" path="box2d\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Collision" path="Collision\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Shapes" path="Shapes\"><File path="b2CircleShape.h"></File><File path="b2EdgeShape.h"></File><File path="b2PolygonShape.h"></File><File path="b2Shape.h"></File></MagicFolder><File path="b2BroadPhase.h"></File><File path="b2Collision.h"></File><File path="b2Distance.h"></File><File path="b2DynamicTree.h"></File><File path="b2PairManager.h"></File><File path="b2TimeOfImpact.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Common" path="Common\"><File path="b2BlockAllocator.h"></File><File path="b2Math.h"></File><File path="b2Settings.h"></File><File path="b2StackAllocator.h"></File><File path="Fixed.h"></File><File path="jtypes.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Dynamics" path="Dynamics\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Contacts" path="Contacts\"><File path="b2CircleContact.h"></File><File path="b2Contact.h"></File><File path="b2ContactSolver.h"></File><File path="b2EdgeAndCircleContact.h"></File><File path="b2NullContact.h"></File><File path="b2PolyAndCircleContact.h"></File><File path="b2PolyAndEdgeContact.h"></File><File path="b2PolyContact.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Controllers" path="Controllers\"><File path="b2BuoyancyController.h"></File><File path="b2ConstantAccelController.h"></File><File path="b2ConstantForceController.h"></File><File path="b2Controller.h"></File><File path="b2GravityController.h"></File><File path="b2TensorDampingController.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Joints" path="Joints\"><File path="b2DistanceJoint.h"></File><File path="b2GearJoint.h"></File><File path="b2Joint.h"></File><File path="b2LineJoint.h"></File><File path="b2MouseJoint.h"></File><File path="b2PrismaticJoint.h"></File><File path="b2PulleyJoint.h"></File><File path="b2RevoluteJoint.h"></File></MagicFolder><File path="b2Body.h"></File><File path="b2ContactManager.h"></File><File path="b2EdgeChain.h"></File><File path="b2Fixture.h"></File><File path="b2Island.h"></File><File path="b2World.h"></File><File path="b2WorldCallbacks.h"></File></MagicFolder><File path="Box2D.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="libwiisprite-source" path="libwiisprite-source\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="docimages" path="docimages\"></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"><File path="gamewindow.h"></File><File path="image.h"></File><File path="layer.h"></File><File path="layermanager.h"></File><File path="quad.h"></File><File path="sprite.h"></File><File path="tiledlayer.h"></File><File path="wiisprite.h"></File></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="mxml-wii" path="mxml-wii\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="build" path="build\"></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="mxml" path="mxml\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><File path="mxml.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="spritemanager" path="spritemanager\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="example" path="example\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="build" path="build\"></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="images" path="images\"><File path="test.h"></File></MagicFolder><File path="color.h"></File><File path="DrawableImage.h"></File><File path="imageloader.h"></File><File path="oggplayer.h"></File><File path="spritemanager.h"></File><File path="TextRender.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="toCopytoSDroot" path="toCopytoSDroot\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="freetype" path="freetype\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="config" path="config\"><File path="ftconfig.h"></File><File path="ftheader.h"></File><File path="ftmodule.h"></File><File path="ftoption.h"></File><File path="ftstdlib.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="internal" path="internal\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="services" path="services\"><File path="svbdf.h"></File><File path="svcid.h"></File><File path="svgldict.h"></File><File path="svgxval.h"></File><File path="svkern.h"></File><File path="svmm.h"></File><File path="svotval.h"></File><File path="svpfr.h"></File><File path="svpostnm.h"></File><File path="svpscmap.h"></File><File path="svpsinfo.h"></File><File path="svsfnt.h"></File><File path="svttcmap.h"></File><File path="svtteng.h"></File><File path="svttglyf.h"></File><File path="svwinfnt.h"></File><File path="svxf86nm.h"></File></MagicFolder><File path="autohint.h"></File><File path="ftcalc.h"></File><File path="ftdebug.h"></File><File path="ftdriver.h"></File><File path="ftgloadr.h"></File><File path="ftmemory.h"></File><File path="ftobjs.h"></File><File path="ftrfork.h"></File><File path="ftserv.h"></File><File path="ftstream.h"></File><File path="fttrace.h"></File><File path="ftvalid.h"></File><File path="internal.h"></File><File path="pcftypes.h"></File><File path="psaux.h"></File><File path="pshints.h"></File><File path="sfnt.h"></File><File path="t1types.h"></File><File path="tttypes.h"></File></MagicFolder><File path="freetype.h"></File><File path="ftbbox.h"></File><File path="ftbdf.h"></File><File path="ftbitmap.h"></File><File path="ftcache.h"></File><File path="ftchapters.h"></File><File path="ftcid.h"></File><File path="fterrdef.h"></File><File path="fterrors.h"></File><File path="ftgasp.h"></File><File path="ftglyph.h"></File><File path="ftgxval.h"></File><File path="ftgzip.h"></File><File path="ftimage.h"></File><File path="ftincrem.h"></File><File path="ftlcdfil.h"></File><File path="ftlist.h"></File><File path="ftlzw.h"></File><File path="ftmac.h"></File><File path="ftmm.h"></File><File path="ftmodapi.h"></File><File path="ftmoderr.h"></File><File path="ftotval.h"></File><File path="ftoutln.h"></File><File path="ftpfr.h"></File><File path="ftrender.h"></File><File path="ftsizes.h"></File><File path="ftsnames.h"></File><File path="ftstroke.h"></File><File path="ftsynth.h"></File><File path="ftsystem.h"></File><File path="fttrigon.h"></File><File path="fttypes.h"></File><File path="ftwinfnt.h"></File><File path="ftxf86.h"></File><File path="t1tables.h"></File><File path="ttnameid.h"></File><File path="tttables.h"></File><File path="tttags.h"></File><File path="ttunpat.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="sdcard" path="sdcard\"><File path="card_buf.h"></File><File path="card_cmn.h"></File><File path="card_io.h"></File><File path="wiisd_io.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="wiiuse" path="wiiuse\"><File path="wiiuse.h"></File><File path="wpad.h"></File></MagicFolder><File path="debug.h"></File><File path="fat.h"></File><File path="ft2build.h"></File><File path="gamewindow.h"></File><File path="image.h"></File><File path="layer.h"></File><File path="layermanager.h"></File><File path="ogcsys.h"></File><File path="quad.h"></File><File path="sprite.h"></File><File path="tiledlayer.h"></File><File path="wiisprite.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="wii" path="wii\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"><File path="color.h"></File><File path="DrawableImage.h"></File><File path="imageloader.h"></File><File path="oggplayer.h"></File><File path="spritemanager.h"></File><File path="TextRender.h"></File></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="wsp" path="wsp\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="examples" path="examples\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="invaders" path="invaders\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="invadersHBC" path="invadersHBC\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="data" path="data\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"><File path="bullet.h"></File><File path="enemy.h"></File><File path="engine.h"></File><File path="entity.h"></File><File path="game.h"></File><File path="intro.h"></File><File path="menu.h"></File><File path="ship.h"></File><File path="title.h"></File></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="spritetest" path="spritetest\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"><File path="libwiisprite.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="spritetestHBC" path="spritetestHBC\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="template" path="template\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="source" path="source\"></MagicFolder></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="libpng" path="libpng\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><File path="png.h"></File><File path="pngconf.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="libwiisprite" path="libwiisprite\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="docs" path="docs\"><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="html" path="html\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="include" path="include\"><File path="gamewindow.h"></File><File path="image.h"></File><File path="layer.h"></File><File path="layermanager.h"></File><File path="quad.h"></File><File path="sprite.h"></File><File path="tiledlayer.h"></File><File path="wiisprite.h"></File></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="lib" path="lib\"></MagicFolder></MagicFolder><MagicFolder excludeFolders="CVS;.svn" filter="*.h" name="Tutorials_files" path="Tutorials_files\"></MagicFolder></MagicFolder></MagicFolder><File path="Makefile"></File></Project>
View
8 application/source/Players/Player.cpp
@@ -8,8 +8,7 @@
#include <Level.h>
#include <Bullets/Bullet.h>
#include <CollisionCategories.h>
-
-
+#include <PeriodicTimer.h>
namespace Polukili
{
@@ -21,6 +20,7 @@ namespace Polukili
{
Console::log(LOG_INFO, "Player::Player() - new player");
this->level->players.push_back(this);
+ this->bulletTimer = new PeriodicTimer(250);
}
/*************************************************/
@@ -34,7 +34,6 @@ namespace Polukili
{
this->Actor::initPhysic(position);
this->body->SetFixedRotation(true);
- this->bulletTimer = new Timer;
b2PolygonDef playerShape;
playerShape.SetAsBox((((float)this->getImageWidth() / Constants::pixelsPerUnits) / 2.0f), (((float)this->getImageHeight() / Constants::pixelsPerUnits) / 2.0f));
playerShape.density = Constants::defaultDensity;
@@ -142,7 +141,7 @@ namespace Polukili
//Shooting & Jumping
if(btnsheld & WPAD_BUTTON_1)
{
- if(this->bulletTimer->getMilliseconds()>=250)
+ if(this->bulletTimer->isExpired())
{
Console::log(LOG_INFO, "will shoot");
Bullets::Bullet* bullet = new Bullets::Bullet(this->level);
@@ -151,7 +150,6 @@ namespace Polukili
//bullet->body->SetAngle(this->aimJoint->GetJointAngle());
Console::log(LOG_INFO, "shot");
- this->bulletTimer->reset();
}
}
if(btnsheld & WPAD_BUTTON_2 )
View
3  application/source/Players/Player.h
@@ -2,6 +2,7 @@
#define Polukili_Players_Player_h
#include <Actor.h>
+#include <PeriodicTimer.h>
namespace Polukili
@@ -76,7 +77,7 @@ namespace Polukili
protected:
b2Body* aimPoint;
b2RevoluteJoint* aimJoint;
- Timer* bulletTimer;
+ PeriodicTimer* bulletTimer;
s32 wiimoteChannel;
/**
* The graphical sprite.
Please sign in to comment.
Something went wrong with that request. Please try again.