File: hull_weapon_follow.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 (37 lines) | stat: -rw-r--r-- 853 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
34
35
36
37
#include "trigtable.h"
#include "bitmap.h"
#include "hull_weapon.h"
#include "hull_weapon_follow.h"

Follow_WHull::Follow_WHull( int _life ):
HullWeapon( 0, _life, 2 ){}

void Follow_WHull::Draw( const Bitmap & who, int x, int y ) {

	for ( int q = 0; q < 12; q++ ) {
		double sx, sy;
		sx = x;
		sy = y;
		double ox = sx;
		double oy = sy;
		int mang = Util::rnd( 360 );
		for ( int z = 0; z < 7; z++ ) {

			sx += Tcos(mang)*2;
			sy += Tsine(mang)*2;
			mang += (Util::rnd( 17 ) - 8) * 4;
			mang += 360;
			mang %= 360;

			int gf = 150 + z * 5;
			// line( who, (int)sx, (int)sy, (int)ox, (int)oy, makecol(gf,gf,gf) );
			who.line( (int)sx, (int)sy, (int)ox, (int)oy, Bitmap::makeColor(gf,gf,gf) );
			ox = sx;
			oy = sy;

		}
	}
	// circlefill( who, x, y, 3, makecol(255,255,255) );
	who.circleFill( x, y, 3, Bitmap::makeColor(255,255,255) );

}