// Jetpac remake using Irrlicht // Copyright Gaz Davidson (gaz@bitplane.net) #ifndef __JETPAC_ENEMY_INCLUDED__ #define __JETPAC_ENEMY_INCLUDED__ #include "Billboard.h" #include "EZXColour.h" namespace irr { namespace scene { class Enemy : public Billboard { public: Enemy(ISceneManager* mgr, video::ITexture* texture, core::vector3df pos, ZXCOLOUR c, s32 ai=0) : Billboard(mgr, texture, 1), AI(ai), NextTime(0) { IsAlive = true; IsDestructable = true; Bill->getMaterial(0).AmbientColor = c; Colour = c; setPosition(pos); setScale(core::vector3df(0.3f,0.3f,0.3f)); updateAbsolutePosition(); Bill->updateAbsolutePosition(); f32 direction = (rand() % 2) ? 1.f : -1.f; f32 direction2= (rand() % 2) ? 1.f : -1.f; Score = 50; switch(AI) { case 0: // floaty { IsFragile = true; f32 speed = (f32) (rand() % 4)+1; Velocity.Y = -0.0001f * speed; Velocity.X = 0.0005f * speed * direction; break; } case 1: // bouncey fuzzballs { Score = 60; Velocity.Y = -0.0025f * direction2; Velocity.X = 0.0025f * direction; break; } case 2: // bubbles { Score = 80; Velocity.Y = -0.0015f * direction2; Velocity.X = 0.0015f * direction; break; } case 3: // jet things { Score = 70; Velocity.Y = -0.0015f * direction2; Velocity.X = 0.003f; break; } case 4: // ufos { Score = 100; Velocity.Y = -0.003f * direction2; Velocity.X = 0.003f * direction; break; } default: break; } setLeftFacing(Velocity.X < 0); } s32 AI; u32 NextTime; ZXCOLOUR Colour; }; } // scene } // irr #endif