File: hull_weapon_emissle.cpp

package info (click to toggle)
rafkill 1.2.2-3.2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 13,264 kB
  • ctags: 5,074
  • sloc: cpp: 13,508; makefile: 64; sh: 14
file content (33 lines) | stat: -rw-r--r-- 838 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
24
25
26
27
28
29
30
31
32
33
#include "spaceobj.h"
#include "defs.h"
#include "bitmap.h"
#include "hull_weapon.h"
#include "hull_weapon_emissle.h"

static const int normal_length = 20;

EMissle_WHull::EMissle_WHull():
HullWeapon( 0, 1, 7 ){}

// #define normal_length 20
void EMissle_WHull::Draw( const Bitmap & who, int x, int y ) {
	/*
	rectfill( who, x-2, y, x+2, y-normal_length, makecol(200,200,200) );
	circlefill( who, x, y, 3, makecol(235,235,235) );
	*/
	who.rectangleFill( x-2, y, x+2, y-normal_length, Bitmap::makeColor(200,200,200) );
	who.circleFill( x, y, 3, Bitmap::makeColor(235,235,235) );
}


bool EMissle_WHull::Collide( int mx, int my, SpaceObject * check ) {

	if ( check->HitMe( mx, my ) )
		return true;
	if ( check->HitMe( mx, my-normal_length/2 ) )
		return true;
	if ( check->HitMe( mx, my-normal_length ) )
		return true;
	return false;

}