summaryrefslogtreecommitdiff
path: root/src/bullet.cpp
blob: fc9961bfcae16b6c96ba831f921ebc43413522c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define BULLET_SPEED 10.0
#define M_PI 3.14159
#include <cmath>
#include "bullet.h"
#include "uiDraw.h"
#include <iostream>
using namespace std;

Bullet :: Bullet() : UFO()
{

}

void Bullet :: draw()
{
   drawDot( point );
}

void Bullet :: fire( Point point , float angle )
{
   float dx = BULLET_SPEED * (-cos(M_PI / 180.0 * angle));
   float dy = BULLET_SPEED * (sin(M_PI / 180.0 * angle));
   setPoint( point );
   setVelocity( dx , dy );
}