Actions

SPG:Ring Loss

From Sonic Retro

Revision as of 12:09, 21 April 2021 by LapperDev (talk | contribs) (Ring bounce info (specifically the behaviour of the ring object itself has been moved to Game Objects)

Ring Limit

When Sonic gets hit, the number of rings he is carrying scatter away, unless he is carrying more than 32, in which case any rings over 32 are ignored. Sonic is therefore no safer carrying 100 rings than 32.

Ring Distribution

The rings that scatter away from Sonic are distributed in a specific pattern of 2 concentric circles, each containing a maximum of 16 rings. The rings in the first circle move outward faster than the rings in the second. Here is a formula for creating the rings, which can be converted into the programming language of your choice:


let t = 0
let angle = 101.25 ; assuming 0=right, 90=up, 180=left, 270=down
let n = false
let speed = 4
 
while t is less than the number of rings max 32
{
    create a bouncing ring object
    set the ring's vertical speed to -sine(angle)*speed
    set the ring's horizontal speed to cosine(angle)*speed
    if n is true
    {
        multiply the ring's horizontal speed by -1
        increase angle by 22.5
    }
    let n = not n ; if n is false, n becomes true and vice versa
    increase t by 1
    if t = 16
    {
        let speed = 2 ; we're on the second circle now, so decrease the speed
        let angle = 101.25 ; and reset the angle
    }
}

So, the first 16 rings move at a velocity of 4 pixels per step, and the second 16 move at half that rate, or 2 pixels per step.

Regathering Rings

64 steps must have passed since Sonic was hit before he can regather any rings, scattered or otherwise.

Invulnerability

Sonic remains invulnerable for a short time after being hit. This invulnerability lasts while Sonic is flying back from the blow, and then 120 steps more after he recovers movement. During those 120 steps, he flashes on and off, spending 4 steps on and 4 steps off.

While in this state, Sonic can not collect level rings until less than 90 invulnerability steps remain.

Ring Depth

All rings, scattered or fixed, have a higher depth than Sonic, i.e. behind him. But they have a lower depth, i.e. in front of him, when they turn into sparkles.