Should be snappier and less prone to crashes. I tested as many scenarios
as I could think of and it has been rock solid. But time will tell.
Also created a new debug log system, just so I could understand what the
hell was going on with this code.
Two players in the same cannon was causing softlocks and general
insanity. Now this should be fixed. Also prevented players from being
able to push or attack a player inside of a cannon.
As noticed by anuserlol, stars would sometimes not spawn from breakable
boxes on the remote. This was due to the box being destroyed before the
star spawned, when the star tried to spawn it couldn't find the parent
and gave up. Now if no parent is found the spawned object will be its
own parent. This should make all spawned objects more reliable, but may
cause weirdness somewhere.
Fixes#34
Since the second-player code was the first code I wrote, it was implemented
poorly. At that point, I didn't know the code base at all and the way it was
written would prevent anyone from ever adding to those parts.
The rewrite allows me to use the default geo.inc.c file for Mario, and removes
all of the geo2.inc.c files. I no longer do a bunch of bit shifting to figure
out which player is being drawn in the rendering code.
I'm also now able to remove tons of duplicate code that exists just for the
remote player. The main player code is generic enough to support both indices.
A side-effect of the rewrite is I was able to remove many assumptions in the
code where two-players is assumed, but many other parts of the code still
assume two players.
This is a fairly major change that, if all goes well, will be completely
unnoticed by the player. However, I do expect new bugs to pop up in strange
places. Time will tell.
Saves and loads last join IP/port attempt
Made host's port configurable in config file
Made host's save slot configurable in config file
Made host's player interaction setting configurable in config file
Indicated when the client was trying to connect on the join menu.
Fixed join menu display error where the port would disappear
Made water punch do an attack
Increased knockback significantly
Different types of attacks will have different knockback severity and damage (Stomp > kick > the rest)
Fixed rapid attack spam
Adjust radius for bouncing on players and popping bubbles
Made player interactions a synchronized server flag:
None - Players are not solid
Solid (Default) - Player can run into each other and stun each other
PVP - Same as solid except friendly fire is on
Note: Not currently configurable due to a lack of a UI.
Player life counters are separate.
When one player dies they lose a life and are turned into a bubble.
If the other player pops it, they are alive again.
If all players are bubbled, they get kicked out of the level.
If the bubbled player ran out of lives, they can not come back to life
until the level is over.
Whenever a level change happens, everyone's life count is set to a
minimum of two.
No game overs.
Took heavy inspiration from Kaze Emanuar