Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.cc @ 11506

Last change on this file since 11506 was 11506, checked in by vyang, 7 years ago

Asteroids, Ship, Stones, Weapon files created

File size: 1.2 KB
Line 
1#include "AsteroidsShip.h"
2
3#include "core/CoreIncludes.h"
4#include "core/XMLPort.h"
5#include "Invader.h"
6#include "InvaderEnemy.h"
7#include "graphics/Camera.h"
8#include "weapons/projectiles/Projectile.h"
9
10namespace orxonox
11{
12    //Constructor
13    RegisterClass(AsteroidsShip);
14
15    AsteroidsShip::AsteroidsShip(Context* context) : SpaceShip(context)
16    {
17        RegisterObject(AsteroidsShip);
18
19        float x = getPosition().x;
20        float y = getPosition().y;
21        float velocityx = 0.0f;
22        float velocityy = 0.0f;
23        this->bBoost_ = false;
24    }
25    //Destructor
26    AsteroidsShip::~AsteroidsShip()
27    {
28        if (this->isInitialized())
29            this->cleanup();
30    }
31
32
33
34    //update coordinates and velocity
35    void AsteroidsShip::tick(float dt)
36    {
37        //Movement computation
38        Vector3 speed = Vector3 (100, 100, 0);
39        Vector3 position = this->getPosition();
40        position += (speed * dt);
41        this->setPosition(position);
42        //roll? muss sich das Raumschiff drehen?
43
44        //Schiessen wenn geschossen wurde
45        // shoot!
46        if (isFireing)
47            ControllableEntity::fire(0);
48       
49        //Leben verloren
50    }
51   
52    void 
53
54
55
56
57}
Note: See TracBrowser for help on using the repository browser.