[Opentnl-cvs] tnl/zap gameItems.cpp,1.1,1.2
Brought to you by:
mark_frohnmayer,
s_alanet
From: Ben G. <s_a...@us...> - 2004-04-25 06:11:15
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7386/zap Modified Files: gameItems.cpp Log Message: Powerups rotate. Might want to move this into the PickupItem class - maybe not, though. Index: gameItems.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameItems.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameItems.cpp 23 Apr 2004 01:50:48 -0000 1.1 --- gameItems.cpp 25 Apr 2004 06:01:30 -0000 1.2 *************** *** 34,40 **** --- 34,45 ---- class RepairItem : public PickupItem { + private: + typedef PickupItem Parent; + F32 spin; + public: RepairItem(Point p = Point()) : PickupItem(p, 20) { + spin=0.f; mNetFlags.set(Ghostable); } *************** *** 77,80 **** --- 82,91 ---- } + void processClient(U32 deltaT) + { + Parent::processClient(deltaT); + spin += 50.f * (F32)deltaT / 1000.f; + } + void renderItem(Point pos) { *************** *** 82,85 **** --- 93,97 ---- glPushMatrix(); glTranslatef(pos.x, pos.y, 0); + glRotatef(spin, 0, 0, 1.f); glColor3f(1, 1, 0); *************** *** 148,150 **** --- 160,163 ---- TNL_IMPLEMENT_NETOBJECT(TestItem); + }; \ No newline at end of file |