Language…
7 users online: Bonobi, Daizo Dee Von, Firstnamebutt, Powblock532, rafaelfutbal, Reggiamoto,  Ringo - Guests: 77 - Bots: 144
Users: 67,562 (2,002 active)
Latest user: Dilshacking

Gacha Egg

SMW Sprites → Gacha Egg

Submission Details

Name: Gacha Egg
Author: MellyMellouange
Added:
Tool: PIXI
Type: Standard
Dynamic: No
Disassembly: No
Includes GFX: No
Description: This Yoshi Egg will hatch into a sprite when in contact with the ground.
Within the ASM file, there are multiple tables determining which sprites can spawn and multiple parameters to apply on creation.
The first extension byte determines which entry to use.
The second extension byte, if nonzero, will be added as a random offset to that entry. Example:
03 00 -- use Entry_03
02 05 -- randomly use any entry between Entry_02 and (2+5) Entry_07

here's a short description of all the tables and what they can do
Main table: Sprite number, index to x/y/xspeed/yspeed table, index to manual init table (for vanilla sprites), index to the extension byte table (for custom sprites), random index offset to the extension byte table, entry in the SFX table, property flags (custom sprite flag, must face Mario flag, Extra Bit, spawns graphical egg pieces when hatching)

Manual init table: values to use for sprite tables at $14C8, $C2, $151C, $1528, $1534, $1540, $154C and $157C

XY table: x offset, y offset, starting x speed, starting y speed

Extension table: values for Extension Bytes 1 through 4

SFX Table: sound effect and sound bank

Might be a bit of a learning curve, but all relevant information is written within the asm file itself. There's also a default list of entries.

Oh, and it's all compatible with both LoROM and sa1.

Um, good luck!

Additional credits to Sonikku for providing the code that spawns graphical egg pieces. And Isikoro for the customizable firebar sprite used in the gifs (for demonstration purpose only)

Small update: made it so the egg won't hatch if it has yet to move, so you could set them in motion with an on/off switch or a P switch
Tags: customizable egg flexible gacha lorom pacifist random sa-1 spawner sprite spawn
Comments: 3 (jump to comments)
Rating:
5.0 (1 rating)
No rating
Download 6.30 KiB | 78 downloads

Screenshots

View all

Comments (3)

 MarioFanGamer Link
Moderated with:
Added pacifist (dubious) and sa-1 and removed sa1, sa1rom and vanilla gfx tags.

Altogether an interesting sprite.

I just feel like it's a bit too limited for what is promised. The biggest one is that it only hatches if it falls onto the ground when you could make it behave like a Baby Yoshi egg for an alternative behaviour. On top of that, I feel like the options are a bit convoluted and would have preferred a tabular spawn pattern (i.e. you define which potential sprites an egg can spawn) instead of using a combiantion of both extra bytes so you don't always have to potentially redefine spawned sprites if you want a different spawn pattern. I do like how you can customise the sprites to spawn, though.
In terms of coding, when the gatcha egg hatches, you call SpawnSprite which is problematic for two reasons:
  1. It doesn't respect the sprite memory settings so it spawns sprites into the reserved sprite slots for powerups (which comes in with various issues).
  2. You don't even need it because you immediately destroy the egg after its content spawns so you can instead initialise the sprite with the egg's index instead (the exception would be if you were to spawn multiple sprites but such an option doesn't exist).

These are still relatively minor issues so nothing for immediate rejection.
HammerBrother Link
Definitely good for bonus levels or some currency system.
Apple Boy Link
Holy peak
This is gonna make for such a chaotic bunch of hacks