File: hull_weapon_rocket_normal.cpp

package info (click to toggle)
rafkill 1.2.2-3.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,268 kB
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (23 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "spaceobj.h"
#include "bitmap.h"
#include "hull_weapon.h"
#include "hull_weapon_rocket_normal.h"
	
static const int Xfactor = 4;
static const int Yfactor = 20;

NormalRocket_WHull::NormalRocket_WHull():
HullWeapon( 0, 1, 20 ){}

void NormalRocket_WHull::Draw( const Bitmap & who, int x, int y ) {
	who.rectangleFill( x, y+3, x+Xfactor, y+Yfactor, Bitmap::makeColor(200,200,200) );
	who.triangle( x, y+3, x+Xfactor/2, y, x+Xfactor, y+3, Bitmap::makeColor(230,230,230) );
}

bool NormalRocket_WHull::Collide( int mx, int my, SpaceObject * check ) {
	if ( check->HitMe( mx, my ) )
		return true;
	if ( check->HitMe( mx+Xfactor/2, my+Yfactor*2/3 ) )
		return true;
	return false;
}