| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Some enemies might die right after moving (e.g. asteroids exploding into
the ground). In these cases, there's no point on checking for player
collision. Moreover, this also avoids the corner case of having two
explosions on a single death.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When shooting like crazy and killing random enemies, after a while a
cycling bug would appear which would make enemies to turn in weird
directions, die unexpectedly, and other weird shenanigans.
This comes back to commit 7c493ba3f338 ("Improve a bit the performance
on enemy death"), which removed the saving/restoring of the value on the
'y' register. That being said, this register was actually being needed
at least by Bullets::update(), so in certain situations this register
might have a bad value (e.g. via the Explosions::create() call).
Fixes: 7c493ba3f338 ("Improve a bit the performance on enemy death")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
It was never read anyways, so let's drop it.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Each enemy also has its own palette upon creation. This way we add more
variety as it was on the original game.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
This allows for explosions to run after making the player to disappear,
and it re-runs the entering scene timer.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
For now this only applies to enemies, but it's general enough so it can
target any given coordinate, and hence any given object.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
This will be useful whenever we implement the re-appearance of enemies.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
| |
There were still some gaps where the check was failing, and trying to be
smart about it was going the "it's too complex for what I need here"
route. Hence, just go to the good old dumb algorithm of "check all
corners". For now the performance has not dropped, so let's hope that we
don't have to re-visit this one.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
| |
This is in preparation to the 'homing' algorithm to re-use this one.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Everywhere except the 'basic' algorithm don't really need this
argument. In the beginning I was using it to define some custom
velocities, but in the end tweaking the inner timer on the 'extra' value
for all enemies turned out to be more productive. Hence, remove this
usage almost everywhere and make the code simpler as a side-effect.
The usage on 'basic' is still under revision, just to check if 'homing'
really needs to set a special argument whenever the 'homing' attack
needs this sort of behavior.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
| |
This allows us to be able to initialize each enemy separately, giving a
more random appearance to it all. This will also come in handy whenever
we want to make enemies re-appear.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
Not the whole thing has been implemented, as it needs a rebump on the
'basic' algorithm so I can re-use it for 'homing' as well.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
I apparently got them all messed up. Let's put them as they were
originally.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
For now only the basic algorithm has been written, but the framework for
adding the rest has also been written down.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
The previous commit only tackled the first enemy, this one handles the
"rest_o_enemies" code flow, which was entirely missing.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
Enemies now have the ability to be displayed on screen, face at the
direction that they were assigned to at random during initialization
time, and they also have a timer that dictates some inner movement,
similarly as it happened in the original game.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
| |
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
| |
The address sanitizer from nasm provides quite a few goodies, so let's
adapt the code more to it to benefit from those.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
|
| |
|
|
|
|
|
|
|
| |
The randomness comes from a pre-computed table of "random" numbers. This
is of course the most simple technique you can come across a code base
for the NES/Famicom, but for the purposes of this game is good enough
and (most importantly) fast.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|
|
|
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
|