Last change
on this file since 1897 was
1896,
checked in by patrick, 21 years ago
|
orxonox/trunk: added ability to shoot. so check out the new release and shoot the fuck up
|
File size:
1.4 KB
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | /* |
---|
4 | orxonox - the future of 3D-vertical-scrollers |
---|
5 | |
---|
6 | Copyright (C) 2004 orx |
---|
7 | |
---|
8 | This program is free software; you can redistribute it and/or modify |
---|
9 | it under the terms of the GNU General Public License as published by |
---|
10 | the Free Software Foundation; either version 2, or (at your option) |
---|
11 | any later version. |
---|
12 | |
---|
13 | ### File Specific: |
---|
14 | main-programmer: Patrick Boenzli |
---|
15 | co-programmer: |
---|
16 | */ |
---|
17 | |
---|
18 | |
---|
19 | #include "shoot_laser.h" |
---|
20 | |
---|
21 | #include <iostream> |
---|
22 | |
---|
23 | |
---|
24 | using namespace std; |
---|
25 | |
---|
26 | |
---|
27 | |
---|
28 | ShootLaser::ShootLaser () |
---|
29 | { |
---|
30 | lastShoot = null; |
---|
31 | } |
---|
32 | |
---|
33 | |
---|
34 | ShootLaser::~ShootLaser () {} |
---|
35 | |
---|
36 | |
---|
37 | void ShootLaser::drawShoot() |
---|
38 | { |
---|
39 | |
---|
40 | //cout << "ShootLaser::drawShoot" << endl; |
---|
41 | /* now draw all the shoots (many) */ |
---|
42 | shoot* tmpShoot = lastShoot; |
---|
43 | while( tmpShoot != null ) |
---|
44 | { |
---|
45 | glPushMatrix(); |
---|
46 | glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor); |
---|
47 | tmpShoot->yCor+=tmpShoot->yInc; |
---|
48 | glScalef(0.1, 0.1, 0.1); |
---|
49 | glutWireCube(1.0); |
---|
50 | glPopMatrix(); |
---|
51 | tmpShoot = tmpShoot->next; |
---|
52 | } |
---|
53 | //cout << "ShootLaser::drawShoot - finished" << endl; |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | void ShootLaser::addShoot(shoot* sh) |
---|
58 | { |
---|
59 | sh->next = null; |
---|
60 | lastShoot = sh; |
---|
61 | } |
---|
62 | |
---|
63 | void ShootLaser::addShoot(float x, float y, float z) |
---|
64 | { |
---|
65 | //cout << "ShootLaser::addShoot" << endl; |
---|
66 | shoot* sh = new shoot; |
---|
67 | sh->xCor = x; sh->yCor = y; sh->zCor = z; |
---|
68 | sh->xInc = 0; sh->yInc = .2; sh->zInc = 0; |
---|
69 | sh->next = lastShoot; |
---|
70 | lastShoot = sh; |
---|
71 | } |
---|
72 | |
---|
Note: See
TracBrowser
for help on using the repository browser.