Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Rainblocks
A falling tetromino game for the Playdate.
Music by [Holizna](https://freemusicarchive.org/music/holiznacc0/lo-fi-and-chill)
Sound effects by [JDWasabi](https://jdwasabi.itch.io/8-bit-16-bit-sound-effects-pack), [ColorAlpha](https://coloralpha.itch.io/50-menu-interface-sfx), and [ObsydianX](https://obsydianx.itch.io/interface-sfx-pack-1)
# Rainblocks

A falling tetromino game for the Playdate.

Music by [Holizna](https://freemusicarchive.org/music/holiznacc0/lo-fi-and-chill)

Sound effects by [JDWasabi](https://jdwasabi.itch.io/8-bit-16-bit-sound-effects-pack), [ColorAlpha](https://coloralpha.itch.io/50-menu-interface-sfx), and [ObsydianX](https://obsydianx.itch.io/interface-sfx-pack-1)
Binary file modified images/block0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/block7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/wrapping-pattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ local setup = function()
Gfx.setDrawOffset(offsetX, offsetY)

local menu = playdate.getSystemMenu()
ModeOption = menu:addOptionsMenuItem("mode", { "regular", "dynamic", "chill" }, currentStage.mode, function(option)
ModeOption = menu:addOptionsMenuItem("mode", { "marathon", "dynamic", "chill" }, currentStage.mode, function(option)
currentStage:setMode(option)
end)
for l = 1, Stage.maxLevel, 1 do
table.insert(Stage.levelStrings, string.format("%02d", l))
end
LevelOption = menu:addOptionsMenuItem("level", Stage.levelStrings, Stage.levelStrings[1], function(option)
currentStage:setLevel(math.tointeger(option), true)
end)
Expand Down Expand Up @@ -160,4 +163,4 @@ end

playdate.deviceWillSleep = function()
currentStage:saveData()
end
end
2 changes: 1 addition & 1 deletion pdxinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ author=Zenzoa
description=A chill falling blocks game for the Playdate.
bundleID=com.zenzoa.rainblocks
version=1.0.1
imagePath=images
imagePath=images
92 changes: 46 additions & 46 deletions scene.lua
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
local scene = {
create = function()
local s = {
bgImageTable = Gfx.imagetable.new('images/bg.gif'),
bgImageIndex = 1,
skyImage = Gfx.image.new('images/sky.png'),
clouds1Image = Gfx.image.new('images/clouds1.png'),
clouds2Image = Gfx.image.new('images/clouds2.png'),
clouds1X = 0,
clouds2X = 0,
animationTimer = nil,
setup = function(self)
self.animationTimer = playdate.timer.new(500, function() self:nextFrame() end)
self.animationTimer.repeats = true
end,
nextFrame = function(self)
self.clouds1X = self.clouds1X + 0.24
self.clouds2X = self.clouds2X + 0.51
if self.clouds1X > 800 then
self.clouds1X = 0
end
if self.clouds2X > 800 then
self.clouds2X = 0
end
self.bgImageIndex = self.bgImageIndex + 1
if self.bgImageIndex > self.bgImageTable:getLength() then
self.bgImageIndex = 1
end
end,
draw = function(self)
self.skyImage:drawIgnoringOffset(0, 0)
self.clouds1Image:drawIgnoringOffset(math.floor(self.clouds1X) - 800, 0)
self.clouds1Image:drawIgnoringOffset(math.floor(self.clouds1X), 0)
self.clouds2Image:drawIgnoringOffset(math.floor(self.clouds2X) - 800, 0)
self.clouds2Image:drawIgnoringOffset(math.floor(self.clouds2X), 0)
local bgImage = self.bgImageTable:getImage(self.bgImageIndex)
bgImage:drawIgnoringOffset(0, 0)
end
}
s:setup()
return s
end
}
return scene
local scene = {
create = function()
local s = {
bgImageTable = Gfx.imagetable.new('images/bg.gif'),
bgImageIndex = 1,
skyImage = Gfx.image.new('images/sky.png'),
clouds1Image = Gfx.image.new('images/clouds1.png'),
clouds2Image = Gfx.image.new('images/clouds2.png'),
clouds1X = 0,
clouds2X = 0,
animationTimer = nil,
setup = function(self)
self.animationTimer = playdate.timer.new(500, function() self:nextFrame() end)
self.animationTimer.repeats = true
end,
nextFrame = function(self)
self.clouds1X = self.clouds1X + 0.24
self.clouds2X = self.clouds2X + 0.51
if self.clouds1X > 800 then
self.clouds1X = 0
end
if self.clouds2X > 800 then
self.clouds2X = 0
end
self.bgImageIndex = self.bgImageIndex + 1
if self.bgImageIndex > self.bgImageTable:getLength() then
self.bgImageIndex = 1
end
end,
draw = function(self)
self.skyImage:drawIgnoringOffset(0, 0)
self.clouds1Image:drawIgnoringOffset(math.floor(self.clouds1X) - 800, 0)
self.clouds1Image:drawIgnoringOffset(math.floor(self.clouds1X), 0)
self.clouds2Image:drawIgnoringOffset(math.floor(self.clouds2X) - 800, 0)
self.clouds2Image:drawIgnoringOffset(math.floor(self.clouds2X), 0)
local bgImage = self.bgImageTable:getImage(self.bgImageIndex)
bgImage:drawIgnoringOffset(0, 0)
end
}

s:setup()
return s
end
}

return scene
Loading