Skip to content

Commit

Permalink
Found another spot where bindAnimationToSprite should always run IMO.
Browse files Browse the repository at this point in the history
  • Loading branch information
deckarep committed Oct 31, 2024
1 parent ac2beb3 commit 883cb3e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,13 @@ If people want to change the overall look and feel or game logic, please fork Du
* Before anyone complains about the port looking like ugly Zig code written like C, this is why I'm taking a multi-phase approach. If you've ever done migrations, changing too many things at once introduces bugs, especially when tests don't exist.
* All original development was done on Apple MacOS Silcon, contributions are welcome for other OSes.
* The game has some multi-player networking code, I don't care about it at the moment so it's not started.
* It's very possible this manual port has introduced a bug or two, the game needs to be well tested.
* It's very possible this manual port has introduced a bug or two, the game needs to be well tested.

## Future ideas
* Introduce heroes that have innate abilities like a Frost Hero that is immune to cold attacks
and is able to dish out there own cold attacks. Or a Fire Hero that can't be frozen. Yeah,
dumb shit like that.
* This would make the game a little more interesting because you can pick up cerrtain heroes
as part of the strategy to help you cope with the certain level.
* Introduce themed levels, like a frost level where most or all baddies are cold-based.
* Introduce upgrades along the way, pick up treason, loot upgrade your heroes.
14 changes: 10 additions & 4 deletions zsrc/game.zig
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,13 @@ fn freezeSnake(snake: *pl.Snake, duration: c_int) void {
.AT_BOTTOM_CENTER,
);
ani.scaled = false;
if (snake.buffs[tps.BUFF_DEFENCE] > 0) {
continue;
}

// TODO: see slowDownSnake comments, I had to remove this code in there...why should this
// if block also be in this function? It doesn't make sense to me.
// Commenting it out for now as well.
// if (snake.buffs[tps.BUFF_DEFENCE] > 0) {
// continue;
// }
ren.bindAnimationToSprite(ani, sprite, true);
}
}
Expand Down Expand Up @@ -869,10 +873,12 @@ fn slowDownSnake(snake: *pl.Snake, duration: c_int) void {
);
ani.lifeSpan = duration;
ani.scaled = false;

// r.c. - This line prevents slow downs from tracking with the sprite when
// BUFF_DEFENCE is non-zero. I don't know why this code is like this. But
// I believe the animations should always track alongside the sprite's x,y coords.
// In other words, bindAnimationToSprite should always be ran.
// In other words, bindAnimationToSprite should always be ran so it's not
// like the original raw C code.

// if (snake.buffs[tps.BUFF_DEFENCE] > 0) {
// continue;
Expand Down

0 comments on commit 883cb3e

Please sign in to comment.