ScummVM API documentation
spacejunk.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1995-1997 Presto Studios, Inc.
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef PEGASUS_NEIGHBORHOOD_MARS_SPACEJUNK_H
26 #define PEGASUS_NEIGHBORHOOD_MARS_SPACEJUNK_H
27 
28 #include "pegasus/movie.h"
29 #include "pegasus/neighborhood/mars/constants.h"
30 #include "pegasus/neighborhood/mars/spacechase3d.h"
31 
32 namespace Pegasus {
33 
34 static const CoordType kJunkMaxScreenSize = 250;
35 
36 static const float kJunkSize = convertScreenVToSpaceY(kShuttleWindowMidV - kJunkMaxScreenSize / 2, kJunkMinDistance) -
37  convertScreenVToSpaceY(kShuttleWindowMidV + kJunkMaxScreenSize / 2, kJunkMinDistance);
38 
39 class SpaceJunk : public ScalingMovie, public Idler {
40 public:
41  SpaceJunk(const DisplayElementID);
42  ~SpaceJunk() override;
43 
44  void setCenter(const CoordType, const CoordType);
45  void setScaleSize(const CoordType);
46 
47  void useIdleTime() override;
48 
49  void launchJunk(int16, CoordType, CoordType);
50 
51  void getJunkPosition(Point3D &);
52  bool isJunkFlying();
53 
54  bool pointInJunk(const Common::Point &);
55 
56  void hitByEnergyBeam(Common::Point impactPoint);
57  void hitByGravitonCannon(Common::Point impactPoint);
58 
59  bool junkFlying() { return _timer.isRunning(); }
60 
61 protected:
62  void rebound(const TimeValue);
63 
64  TimeBase _timer;
65  Point3D _launchPoint, _junkPosition;
66  Common::Point _center;
67  bool _bouncing;
68  Common::Point _bounceStart, _bounceStop;
69  CoordType _bounceSizeStart, _bounceSizeStop;
70  TimeValue _bounceTime;
71 };
72 
73 extern SpaceJunk *g_spaceJunk;
74 
75 } // End of namespace Pegasus
76 
77 #endif
Definition: timers.h:37
Definition: spacechase3d.h:50
Definition: movie.h:95
Definition: timers.h:63
Definition: spacejunk.h:39
Definition: rect.h:45
Definition: ai_action.h:33