Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F630068
Spaceship.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
423 B
Referenced Files
None
Subscribers
None
Spaceship.cpp
View Options
#include
"Spaceship.h"
extern
int
width
;
extern
int
height
;
Spaceship
::
Spaceship
(
int
x
,
int
y
)
{
x_pos
=
x
;
y_pos
=
y
;
boxright
=
60
;
boxleft
=
60
;
boxheight
=
15
;
health
=
60
;
active
=
true
;
}
Spaceship
::
Spaceship
()
{}
void
Spaceship
::
MoveSpaceshipLeft
()
//left bound
{
if
(
x_pos
>=
50
)
x_pos
=
x_pos
-
7
;
}
void
Spaceship
::
MoveSpaceshipRight
()
//right bound
{
if
(
x_pos
<
width
-
50
)
x_pos
=
x_pos
+
7
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 8:33 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
110666
Default Alt Text
Spaceship.cpp (423 B)
Attached To
Mode
R72 DarthInvaders
Attached
Detach File
Event Timeline