Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Hot Frog Transition
Browse files Browse the repository at this point in the history
The frog now glows when the Blitz Meter goes up, just like how it should be
  • Loading branch information
ShamblesSM committed Jan 31, 2023
1 parent d55d537 commit 9cb0291
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 0 deletions.
1 change: 1 addition & 0 deletions games/ZumaBlitzRemake/config/shooters/frogatar_basic.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../../../../schemas/config/shooter.json",
"sprite": "sprites/game/shooters/frogatar_basic/shooter.json",
"hotFrogTransitionSprite": "sprites/game/shooters/frogatar_basic/hot_frog_transition.json",
"shadowSprite": "sprites/game/shooters/frogatar_basic/shooter_shadow.json",
"reticle": {},
"speedShotBeam": {
Expand Down
1 change: 1 addition & 0 deletions games/ZumaBlitzRemake/config/shooters/spirit_turtle.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "../../../../schemas/config/shooter.json",
"sprite": "sprites/game/shooters/spirit_turtle/shooter.json",
"hotFrogTransitionSprite": "sprites/game/shooters/spirit_turtle/hot_frog_transition.json",
"shadowSprite": "sprites/game/shooters/spirit_turtle/shooter_shadow.json",
"reticle": {},
"speedShotBeam": {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"path": "images/game/shooters/frogatar_basic/hot_frog_transition.png",

"frame_size": {
"x": 118,
"y": 96
},
"states": [
{
"pos": {
"x": 0,
"y": 0
},
"frames": {
"x": 1,
"y": 1
}
}
],
"internal": false,
"batched": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"path": "images/game/shooters/spirit_turtle/hot_frog_transition.png",

"frame_size": {
"x": 118,
"y": 96
},
"states": [
{
"pos": {
"x": 0,
"y": 0
},
"frames": {
"x": 1,
"y": 1
}
}
],
"internal": false,
"batched": false
}
4 changes: 4 additions & 0 deletions schemas/config/shooter.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"type": "string",
"description": "The sprite for the shooter to be used."
},
"hotFrogTransitionSprite": {
"type": "string",
"description": "The sprite for the shooter overlay to be used while the Blitz Meter is rising. Optional fork-specific property."
},
"spriteOffset": {
"$ref": "../_structures/Vector2.json",
"description": "The offset of the shooter sprite."
Expand Down
2 changes: 2 additions & 0 deletions src/Configs/Shooter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ function ShooterConfig:new(data, path)
self.movement = ShooterMovementConfig(data.movement, path)

self.sprite = _Game.resourceManager:getSprite(data.sprite)
---@type Sprite?
self.hotFrogTransitionSprite = (data.hotFrogTransitionSprite and _Game.resourceManager:getSprite(data.hotFrogTransitionSprite)) or nil
---@type Vector2
self.spriteOffset = _ParseVec2(data.spriteOffset) or Vec2()
---@type Vector2
Expand Down
9 changes: 9 additions & 0 deletions src/Shooter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function Shooter:changeTo(name)
self.movement = self.levelMovement or self.config.movement

self.sprite = self.config.sprite
self.hotFrogTransitionSprite = self.config.hotFrogTransitionSprite
self.shadowSprite = self.config.shadowSprite
self.speedShotSprite = self.config.speedShotBeam.sprite

Expand Down Expand Up @@ -373,6 +374,14 @@ function Shooter:draw()
end
sprite:draw(self.pos + self.config.nextBallOffset:rotate(self.angle), self.config.nextBallAnchor, nil, self:getNextSphereFrame(), self.angle)

-- FORK-SPECIFIC CODE:
-- hot frog transition
---@type Sprite?
local hotfrogtr = self.config.hotFrogTransitionSprite or nil
if hotfrogtr then
hotfrogtr:draw(self.pos + self.config.spriteOffset:rotate(self.angle), self.config.spriteAnchor, nil, nil, self.angle, nil, _Game.session.level.blitzMeter)
end

--local p4 = posOnScreen(self.pos)
--love.graphics.rectangle("line", p4.x - 80, p4.y - 15, 160, 30)
end
Expand Down

0 comments on commit 9cb0291

Please sign in to comment.