Age | Commit message (Collapse) | Author |
|
Now that respawns can get immediately infected, things get crazy
as they should - so make it a bit easier to hoard all the teepee.
I'm pretty sure you can just hide off-screen at the top and
collect teepee and masks without ever touching a baby and just
dodging animated viruses as a way to cheat and "win". But that's
kind of allegorical for the pandemic, isn't it? Ignore the needs
of others while hoarding teepee and masks FTW!
|
|
Nothing functionally changed, just naming some magic numbers and
putting them somewhere more organized.
|
|
This looks like a harmless copy paste bug in 55b7b49, but it's
pointless to do twice.
|
|
Dunno why PabloDraw omitted the SAUCE info when creating this
originally, but it was producing an 80 column rendering of the
mask which is more like 43 columns. This resulted in the
collision box/aabb being far larger than the actual mask as
rendered.
Now with the fixed rendering the mask's scale factor needed some
tweaking as well to preserve the same visual size more or less.
|
|
Previously respawned babies could respawn on a virus without
becoming infected, and this actually had a calming effect on the
late stage of the game which is the opposite of what should be
happening as the field fills up with viruses.
What would happen is eventually most of the active set of babies
would be sitting on viruses and isolated by viruses so they
wouldn't likely be resuced, but they also weren't becoming
infected despite being on viruses.
With this change, baby respawning is handled strictly by a timer,
currently every .5s. In that timer handler the number of babies
off from the GAME_NUM_BABIES (10 presently) are attempted to be
respawned. Any of those which are immediately respawned onto
viruses are immediately infected. Then the same thing is
revisted on the next timer expiration.
So it doesn't try very hard to maintain GAME_NUM_BABIES as alive
at all times - this actually becomes impossible when the field is
too crowded to even find spots to respawn without infection.
Instead, what will happen, is in the end game you just have
constant babies respawning and dying every .5s.
The gameplay is dramatically different now, and it's potentially
too difficult now to actually manage to hoard 256 rolls of
TP before dying. I haven't managed it in my testing so far...
so the probabilities may need to be revisited again.
However, the end game /feels/ much more _right_ after this
change. You end up with just tons of viruses and death, and if
you've managed to hoard a bunch of toilet paper, it's a grim
satirical scene of zero living babies, viruses everywhere, but a
happy pile of TP icons. I can only imagine how ridiculous it
looks if you manage to actually win and get the animated
celebratory wall of TP over the sea of death.
Now the dead babies turned viruses just need their own unique
sprite showing actual infected corpses instead of the same virus
sprite. So it's actually visibly a sea of infected bodies...
|
|
(entity_t.flashes_remaining == 0) was being misused to indicate
an entity wasn't on any of the flashers lists.
At some point during the feature's development that was actually
true, but as the code evolved that was no longer the case and
entities would sit in the flashers_off list with
flashes_remaining at 0 before flipping back on for a cycle at
which point they'd be found with 0 flashes_remaining and dropped
from any flashers lists.
This is a problem because flash_entity() would come along and
use the flashes_remaining == 0 state to see if the entity needed
to get on a flashers list before resetting the flashes_remaining
count.
Furthermore, when adult->holding gets cleared (baby drop off) the
flashes_remaining gets zeroed to ensure the reset baby doesn't
start out with residual flashing at its new location. This just
created more opportunities where the flashes_remaining is zero
while still on a list, since the holding reset was just
expediting the list removal - not actually doing it.
This commit simply introduces a discrete flag for flashing vs.
not flashing to indicate flashers_{on,off} list membership,
independent of the flashes_remaining count.
Fixes infinite loop / apparent freeze bug reported by Tara and
Phil during some play testing. Thanks guys!
|
|
Emscripten integration will want this function.
A few mechanical changes required to catch up with upstream
libplay API changes as well.
|
|
- flash masked adult when hit by virus
- flash held baby and teepee when teepee pickup blocked by held
baby (and block teepee pickup when holding a baby)
|
|
This just adds a basic flashing entity mechanism, but doesn't
make anything actually flash yet.
The intention is to make the adult flash briefly when hit by a
virus while masked, and to flash a held baby and teepee when
attempting to pickup the teepee while holding the baby.
|
|
It might make sense to have a separate .wav for this, but since I
don't currently have anything to put there just use the same
wav.
|
|
The icons grid was shifted left slightly...
|
|
Until now keyboard movements could "cheat" by moving faster on
the diagonals. Instead put all the movements through the same
normalizing introduced by the touch handling.
|
|
lower likelihoods of the >1 quantities to make it a bit more
difficult
|
|
This makes hoarding 256 rolls explode the rolls then infinitely
scroll+rotate them while showing the high score and waiting for
keypress.
|
|
just adding an explicit cast
|
|
|
|
For now this just does the same thing as dying, I need
to either animate something interesting or add a .ans
to show something celebratory like the monkey sitting on
a mountain of TP.
|
|
This shows the teeepee quantity alongside the TP sprite, with
a little fade+wiggle animation when the TP is collected.
|
|
In the interests of making it realistically possible to
completely fill the 256 spots of teepee icons as a winning
condition, there's now mega packs of rolls.
There will need to be some visible indication of qty added,
either numerically or with different graphics. I'm leaning
towards just adding numeric quantity values like +3 or +36
over the roll which floats away when you take it.
|
|
for now toilet paper is simply picked up by the adult and
accumulates as a pointless icon starting at the top left corner,
potentially filling the entire screen with enough hoarding;
obstructing the player's view of what's going on.
There's no points added for hoarding, it's completely pointless
and counterproductive.
|
|
- make mask protection additive rather than absolute, so you can
accumulate mask hit points
- raise the mask stage_t.layer 3->4 so it's less obscured
|
|
baby vs. mask: baby steals and wears mask as useless hat,
adult vs. mask: adult wears mask for 3 hits of virus protection
virus vs. masked adult: decrements mask hit points
virus vs. hatted baby: same as virus vs. unmasked baby
TODO:
- visible indication of how many remaining hits mask has
- maybe blink mask when one hit remains
- sfx for adult mask wearing and loss, baby mask stealing?
- sfx for virus vs. mask?
|
|
also s/frozen/captivated/ for consistency with sfx
|
|
Existing code wouldn't notice when a TV-attracted baby collided
with an existing inanimate infection (previously infected baby)
This commit adds a nested search in tv_search for the affected
baby case, to detect such collisions. Note this required bumping
the max nested search for the ix2 from 1 to 2, comment updated to
reflect that.
|
|
The existing code wouldn't handle when newly infected babies
overlapped with other uninfected babies, creating potential
outcomes where a stationary virus is left visibly touching an
uninfected baby.
This commit puts new infections on a list to be processed like
viruses after performing the per-virus search creating the new
infections. Now when a newly infected baby is touching other
babies, those other babies become immediately infected as well.
|
|
It's possible for babies to overlap and a virus to encounter them
simultaneously. The existing code halted the search on the first
hit. This commit changes things to continue the search and
infect all hits before resetting the infecting virus.
|
|
Now nearby babies migrate towards the TV
|
|
This name already doesn't quite reflect what's happening since
the addition of the TV.
There will be more non-viruses stuff added to this function only
making the existing name even more wrong. Renaming for better
accuracy along with the associated timer's symbolic constants.
No functional changes...
|
|
When a touch is active, the player progresses towards the touch
position.
The scaling of the touch coordinates is a bit oversized so you
can place the adult off-screen to rescue babies, without your
finger actually going off-screen.
|
|
The bulk of this is mechanical wiring up of a projection_x to all
the nodes.
But this also introduces maintenance of the projection_x, with
aspect-ratio preservation in two of the modes: WINDOWED and
FULLSCREEN, with the previously default stretched-to-fill
fullscreen mode now relegated to a third FILLSCREEN winmode.
The default at startup is now an aspect ratio-preserving windowed
mode.
Simply press the 'f' key at any time to cycle through them.
This was mostly done in sars to provide a source-available test
for reproducing a fullscreen SDL2 bug I filed @
https://github.com/libsdl-org/SDL/issues/5139
Otherwise it's pretty silly to bother with doing anything on
sars... but it is a handy little mule for such things.
|
|
Newer libstage cleans up the parent/adopt conf naming a bit, fixup
relevant call sites to reflect that.
|
|
Cosmetic change getting rid of a FIXME from the code
|
|
Some substitution errors, some stale stuff, some unnecessarily
conversational crap resulting from drunk overnighter coding.
|
|
just some missing whitespace
|
|
Missing comma silently resulted in aabb_any.min.x == -2
Excellent example of how using the same syntax for negative and
the subtraction operator creates opportunity for silent bugs.
This is the first time this particular thing has bitten me, doing
mostly systems programming throughout my life I haven't dealt much
with negative values and certainly not frequently initializing bags
of them as is common in game development.
This bug is why the collision hit boxes seemed so huge, it was only
on the horizontal axis, and actually just the minimum side but in-play
it appears to be both since there's always a minimum involved on a
horizontal collision.
Sigh.
|
|
Missed two first time around
|
|
|
|
The m4f_3dx.h helpers know to give an identity on NULL...
No functional difference, just removing some kruft.
|
|
Rather than a new-then-free dance this avoids creating a new
stage_t altogether by installing the new object into the existing
one via the stage_conf_t.parent pointer combined with adopt flag.
|
|
The theme of this Blender was:
Monkeys / Rescuing / Between Realities
With all the COVID-19 stuff going on, it seemed like a fun way
to lighten things up a bit to make something where a monkey runs
around trying to rescue child monkeys from coronaviruses moving
across the playfield. In keeping with the theme, to rescue the
helpless monkeys you take them to a different reality by carrying
them off the window/screen. As infections increase the field
becomes crowded with viruses until your player becomes infected
through contact, ending your game.
This was written quickly kamikaze style overnight. Some
scaffolding bits came from past projects of mine like the vector
headers, shader and texture node building blocks, and the plasma
effect has been used a few times now and originally was derived
from some gpu programming tutorial if memory serves. I just
wanted to put something in the background for this strange
reality.
This is the first time I've used libplay, in fact, it was
basically slapped together last night at the start of this to
avoid having to do all that SDL initialization all over again.
The unique meat of this work is in game.c, there isn't really all
that much to this game though. It's not pretty code, but it
works well enough and this task served as a useful exercise of
trying to get some quick game dev done using this collection of
facilities.
Most the heavy lifting comes from my reused libraries which are
slowly evolving into something somewhat effective for simple game
development.
Enjoy, and happy hacking!
|