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
9b756efc
Commit
9b756efc
authored
Feb 15, 2010
by
alistert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stopped events firing non-existent bullets.
parent
4cdf7392
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
21 deletions
+22
-21
event.h
src/level/event/event.h
+2
-1
eventframe.cpp
src/level/event/eventframe.cpp
+20
-20
No files found.
src/level/event/event.h
View file @
9b756efc
...
...
@@ -11,7 +11,7 @@
* Part of the OpenJazz project
*
*
* Copyright (c) 2005-20
09
Alister Thomson
* Copyright (c) 2005-20
10
Alister Thomson
*
* OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0
...
...
@@ -65,6 +65,7 @@
// Delays
#define T_FLASH 100
#define T_FINISH 200
#define T_SHOOT 300
// Speed factors
#define ES_SLOW 80
...
...
src/level/event/eventframe.cpp
View file @
9b756efc
...
...
@@ -8,7 +8,7 @@
* Part of the OpenJazz project
*
*
* Copyright (c) 2005-20
09
Alister Thomson
* Copyright (c) 2005-20
10
Alister Thomson
*
* OpenJazz is distributed under the terms of
* the GNU General Public License, version 2.0
...
...
@@ -73,7 +73,7 @@ bool Event::step (unsigned int ticks, int msps) {
// Find frame
if
(
animType
&&
(
set
[
animType
]
>=
0
))
{
if
((
animType
==
E_LFINISHANIM
)
||
(
animType
==
E_RFINISH
ANIM
))
if
((
animType
!=
E_LEFTANIM
)
&&
(
animType
!=
E_RIGHT
ANIM
))
frame
=
(
ticks
+
T_FINISH
-
level
->
getEventTime
(
gridX
,
gridY
))
/
40
;
else
if
(
set
[
E_ANIMSP
])
frame
=
ticks
/
(
set
[
E_ANIMSP
]
*
40
);
...
...
@@ -826,29 +826,13 @@ bool Event::step (unsigned int ticks, int msps) {
if
(
set
[
E_BULLETSP
])
{
if
((
ticks
%
(
set
[
E_BULLETSP
]
*
25
)
>
(
unsigned
int
)(
set
[
E_BULLETSP
]
*
25
)
-
200
)
&&
(
unsigned
int
)(
set
[
E_BULLETSP
]
*
25
)
-
T_SHOOT
)
&&
((
animType
==
E_LEFTANIM
)
||
(
animType
==
E_RIGHTANIM
)))
{
if
(
animType
==
E_LEFTANIM
)
animType
=
E_LSHOOTANIM
;
else
animType
=
E_RSHOOTANIM
;
}
if
((
ticks
%
(
set
[
E_BULLETSP
]
*
25
)
<
(
unsigned
int
)(
set
[
E_BULLETSP
]
*
25
)
-
200
)
&&
((
animType
==
E_LSHOOTANIM
)
||
(
animType
==
E_RSHOOTANIM
)))
{
if
(
animType
==
E_RSHOOTANIM
)
{
level
->
firstBullet
=
new
Bullet
(
this
,
true
,
ticks
);
animType
=
E_RIGHTANIM
;
}
else
{
level
->
firstBullet
=
new
Bullet
(
this
,
false
,
ticks
);
animType
=
E_LEFTANIM
;
}
level
->
setEventTime
(
gridX
,
gridY
,
ticks
+
T_SHOOT
);
}
...
...
@@ -866,6 +850,22 @@ bool Event::step (unsigned int ticks, int msps) {
return
true
;
}
else
if
(
animType
==
E_LSHOOTANIM
)
{
if
((
set
[
E_BULLET
]
<
32
)
&&
(
level
->
getBullet
(
set
[
E_BULLET
])[
B_SPRITE
]
!=
0
))
level
->
firstBullet
=
new
Bullet
(
this
,
false
,
ticks
);
animType
=
E_LEFTANIM
;
}
else
if
(
animType
==
E_RSHOOTANIM
)
{
if
((
set
[
E_BULLET
]
<
32
)
&&
(
level
->
getBullet
(
set
[
E_BULLET
])[
B_SPRITE
+
1
]
!=
0
))
level
->
firstBullet
=
new
Bullet
(
this
,
true
,
ticks
);
animType
=
E_RIGHTANIM
;
}
else
{
// Change the water level
...
...
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