Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
openjazz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
openjazz
Commits
9a9d034d
Commit
9a9d034d
authored
Mar 10, 2010
by
alistert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed which animation is used for shooting position while standing.
parent
1938b689
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
74 deletions
+68
-74
player.cpp
src/player/player.cpp
+0
-15
player.h
src/player/player.h
+0
-1
playerframe.cpp
src/player/playerframe.cpp
+68
-58
No files found.
src/player/player.cpp
View file @
9a9d034d
...
@@ -667,21 +667,6 @@ bool Player::overlap (fixed left, fixed top, fixed width, fixed height) {
...
@@ -667,21 +667,6 @@ bool Player::overlap (fixed left, fixed top, fixed width, fixed height) {
}
}
bool
Player
::
isOnPlatform
()
{
// Check for platform event, bridge or level mask below player
return
(
event
>=
3
)
||
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
1
)
||
level
->
checkMaskDown
(
x
+
PXO_MID
,
y
+
1
)
||
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
1
)
||
((
dx
>
0
)
&&
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
F8
))
||
((
dx
<
0
)
&&
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
F8
));
}
void
Player
::
setPosition
(
fixed
newX
,
fixed
newY
)
{
void
Player
::
setPosition
(
fixed
newX
,
fixed
newY
)
{
x
=
newX
;
x
=
newX
;
...
...
src/player/player.h
View file @
9a9d034d
...
@@ -191,7 +191,6 @@ class Player : public Movable {
...
@@ -191,7 +191,6 @@ class Player : public Movable {
unsigned
char
team
;
unsigned
char
team
;
void
addAmmo
(
int
type
,
int
amount
);
void
addAmmo
(
int
type
,
int
amount
);
bool
isOnPlatform
();
public
:
public
:
int
teamScore
;
int
teamScore
;
...
...
src/player/playerframe.cpp
View file @
9a9d034d
...
@@ -60,6 +60,8 @@ void Player::control (unsigned int ticks, int msps) {
...
@@ -60,6 +60,8 @@ void Player::control (unsigned int ticks, int msps) {
}
}
animType
=
facing
?
PA_RDIE
:
PA_LDIE
;
return
;
return
;
}
}
...
@@ -108,6 +110,15 @@ void Player::control (unsigned int ticks, int msps) {
...
@@ -108,6 +110,15 @@ void Player::control (unsigned int ticks, int msps) {
if
(
dx
>
PXS_RUN
)
dx
=
PXS_RUN
;
if
(
dx
>
PXS_RUN
)
dx
=
PXS_RUN
;
// Check for platform event, bridge or level mask below player
platform
=
(
event
>=
3
)
||
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
1
)
||
level
->
checkMaskDown
(
x
+
PXO_MID
,
y
+
1
)
||
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
1
)
||
((
dx
>
0
)
&&
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
F8
))
||
((
dx
<
0
)
&&
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
F8
));
if
(
floating
)
{
if
(
floating
)
{
if
(
pcontrols
[
C_UP
])
{
if
(
pcontrols
[
C_UP
])
{
...
@@ -201,8 +212,6 @@ void Player::control (unsigned int ticks, int msps) {
...
@@ -201,8 +212,6 @@ void Player::control (unsigned int ticks, int msps) {
}
else
{
}
else
{
platform
=
isOnPlatform
();
if
(
platform
&&
pcontrols
[
C_JUMP
]
&&
if
(
platform
&&
pcontrols
[
C_JUMP
]
&&
!
level
->
checkMask
(
x
+
PXO_MID
,
y
-
F36
))
{
!
level
->
checkMask
(
x
+
PXO_MID
,
y
-
F36
))
{
...
@@ -296,6 +305,9 @@ void Player::control (unsigned int ticks, int msps) {
...
@@ -296,6 +305,9 @@ void Player::control (unsigned int ticks, int msps) {
if
((
ticks
>
fireTime
)
&&
(
level
->
getBullet
(
ammoType
+
1
)[
B_SPRITE
]
!=
0
))
{
if
((
ticks
>
fireTime
)
&&
(
level
->
getBullet
(
ammoType
+
1
)[
B_SPRITE
]
!=
0
))
{
// Make sure bullet position is taken from correct animation
if
(
platform
)
animType
=
facing
?
PA_RSHOOT
:
PA_LSHOOT
;
// Create new bullet
// Create new bullet
level
->
firstBullet
=
new
Bullet
(
this
,
false
,
ticks
);
level
->
firstBullet
=
new
Bullet
(
this
,
false
,
ticks
);
...
@@ -343,6 +355,60 @@ void Player::control (unsigned int ticks, int msps) {
...
@@ -343,6 +355,60 @@ void Player::control (unsigned int ticks, int msps) {
}
}
// Choose animation
if
((
reaction
==
PR_HURT
)
&&
(
reactionTime
-
ticks
>
PRT_HURT
-
PRT_HURTANIM
))
animType
=
facing
?
PA_RHURT
:
PA_LHURT
;
else
if
(
y
+
PYO_MID
>
level
->
getWaterLevel
())
animType
=
facing
?
PA_RSWIM
:
PA_LSWIM
;
else
if
(
floating
)
animType
=
facing
?
PA_RBOARD
:
PA_LBOARD
;
else
if
(
dy
<
0
)
{
if
(
event
==
1
)
animType
=
facing
?
PA_RSPRING
:
PA_LSPRING
;
else
animType
=
facing
?
PA_RJUMP
:
PA_LJUMP
;
}
else
if
(
platform
)
{
if
(
dx
)
{
if
(
dx
<=
-
PXS_RUN
)
animType
=
PA_LRUN
;
else
if
(
dx
>=
PXS_RUN
)
animType
=
PA_RRUN
;
else
if
((
dx
<
0
)
&&
facing
)
animType
=
PA_LSTOP
;
else
if
((
dx
>
0
)
&&
!
facing
)
animType
=
PA_RSTOP
;
else
animType
=
facing
?
PA_RWALK
:
PA_LWALK
;
}
else
if
(
!
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
F12
)
&&
!
level
->
checkMaskDown
(
x
+
PXO_L
,
y
+
F2
)
&&
(
event
!=
3
)
&&
(
event
!=
4
))
animType
=
PA_LEDGE
;
else
if
(
!
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
F12
)
&&
!
level
->
checkMaskDown
(
x
+
PXO_R
,
y
+
F2
)
&&
(
event
!=
3
)
&&
(
event
!=
4
))
animType
=
PA_REDGE
;
else
if
((
lookTime
<
0
)
&&
((
int
)
ticks
>
1000
-
lookTime
))
animType
=
PA_LOOKUP
;
else
if
(
lookTime
>
0
)
{
if
((
int
)
ticks
<
1000
+
lookTime
)
animType
=
facing
?
PA_RCROUCH
:
PA_LCROUCH
;
else
animType
=
PA_LOOKDOWN
;
}
else
if
(
pcontrols
[
C_FIRE
])
animType
=
facing
?
PA_RSHOOT
:
PA_LSHOOT
;
else
animType
=
facing
?
PA_RSTAND
:
PA_LSTAND
;
}
else
animType
=
facing
?
PA_RFALL
:
PA_LFALL
;
return
;
return
;
}
}
...
@@ -623,62 +689,6 @@ void Player::draw (unsigned int ticks, int change) {
...
@@ -623,62 +689,6 @@ void Player::draw (unsigned int ticks, int change) {
drawY
=
getDrawY
(
change
);
drawY
=
getDrawY
(
change
);
// Choose player animation
if
(
reaction
==
PR_KILLED
)
animType
=
facing
?
PA_RDIE
:
PA_LDIE
;
else
if
((
reaction
==
PR_HURT
)
&&
(
reactionTime
-
ticks
>
PRT_HURT
-
PRT_HURTANIM
))
animType
=
facing
?
PA_RHURT
:
PA_LHURT
;
else
if
(
y
+
PYO_MID
>
level
->
getWaterLevel
())
animType
=
facing
?
PA_RSWIM
:
PA_LSWIM
;
else
if
(
floating
)
animType
=
facing
?
PA_RBOARD
:
PA_LBOARD
;
else
if
(
dy
<
0
)
{
if
(
event
==
1
)
animType
=
facing
?
PA_RSPRING
:
PA_LSPRING
;
else
animType
=
facing
?
PA_RJUMP
:
PA_LJUMP
;
}
else
if
(
isOnPlatform
())
{
if
(
dx
)
{
if
(
dx
<=
-
PXS_RUN
)
animType
=
PA_LRUN
;
else
if
(
dx
>=
PXS_RUN
)
animType
=
PA_RRUN
;
else
if
((
dx
<
0
)
&&
facing
)
animType
=
PA_LSTOP
;
else
if
((
dx
>
0
)
&&
!
facing
)
animType
=
PA_RSTOP
;
else
animType
=
facing
?
PA_RWALK
:
PA_LWALK
;
}
else
if
(
!
level
->
checkMaskDown
(
x
+
PXO_ML
,
y
+
F12
)
&&
!
level
->
checkMaskDown
(
x
+
PXO_L
,
y
+
F2
)
&&
(
event
!=
3
)
&&
(
event
!=
4
))
animType
=
PA_LEDGE
;
else
if
(
!
level
->
checkMaskDown
(
x
+
PXO_MR
,
y
+
F12
)
&&
!
level
->
checkMaskDown
(
x
+
PXO_R
,
y
+
F2
)
&&
(
event
!=
3
)
&&
(
event
!=
4
))
animType
=
PA_REDGE
;
else
if
((
lookTime
<
0
)
&&
((
int
)
ticks
>
1000
-
lookTime
))
animType
=
PA_LOOKUP
;
else
if
(
lookTime
>
0
)
{
if
((
int
)
ticks
<
1000
+
lookTime
)
animType
=
facing
?
PA_RCROUCH
:
PA_LCROUCH
;
else
animType
=
PA_LOOKDOWN
;
}
else
if
(
pcontrols
[
C_FIRE
])
animType
=
facing
?
PA_RSHOOT
:
PA_LSHOOT
;
else
animType
=
facing
?
PA_RSTAND
:
PA_LSTAND
;
}
else
animType
=
facing
?
PA_RFALL
:
PA_LFALL
;
// Choose sprite
// Choose sprite
an
=
getAnim
();
an
=
getAnim
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment