Compare commits

..

10 commits

34 changed files with 156 additions and 109 deletions

@ -1 +1 @@
Subproject commit c8b0989378fedf7730727349c7e26815b61cfb02
Subproject commit 57ccb75151e4133e18e64fe42f07e1a4a676026b

BIN
cube-tube.keystore Normal file

Binary file not shown.

View file

@ -208,15 +208,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Cube Tube"
"ProductCode" = "8:{0DF427A0-5821-48F0-9CA5-B34F1123F839}"
"PackageCode" = "8:{27B06BB4-4B81-4D50-A8E0-10378563DE9D}"
"ProductCode" = "8:{FAD41339-47C6-4BE0-9CE0-901208A5F92D}"
"PackageCode" = "8:{485042AA-0822-4605-9240-4B88CAAE3CCE}"
"UpgradeCode" = "8:{CD4947B5-EF08-4530-A370-44E0B5F6F762}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:0.1.1"
"ProductVersion" = "8:0.2.0"
"Manufacturer" = "8:death.au"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"

View file

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

View file

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View file

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -1,112 +1,112 @@
{
"images" : [
{
"filename" : "icon-20pt@2x.png",
"filename" : "AppIcon20x20@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "icon-20pt@3x.png",
"filename" : "AppIcon20x20@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "icon-29pt@2x.png",
"filename" : "AppIcon29x29@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "icon-29pt@3x.png",
"filename" : "AppIcon29x29@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "icon-38pt@2x.png",
"filename" : "AppIcon38x38@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "38x38"
},
{
"filename" : "icon-38pt@3x.png",
"filename" : "AppIcon38x38@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "38x38"
},
{
"filename" : "icon-40pt@2x.png",
"filename" : "AppIcon40x40@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "icon-40pt@3x.png",
"filename" : "AppIcon40x40@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "icon-60pt@2x.png",
"filename" : "AppIcon60x60@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "icon-60pt@3x.png",
"filename" : "AppIcon60x60@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "icon-64pt@2x.png",
"filename" : "AppIcon64x64@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "64x64"
},
{
"filename" : "icon-64pt@3x.png",
"filename" : "AppIcon64x64@3x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "3x",
"size" : "64x64"
},
{
"filename" : "icon-68pt@2x.png",
"filename" : "AppIcon68x68@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "68x68"
},
{
"filename" : "icon-76pt@2x.png",
"filename" : "AppIcon76x76@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "icon-83.5pt@2x.png",
"filename" : "AppIcon83.5x83.5@2x.png",
"idiom" : "universal",
"platform" : "ios",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "icon-1024pt.png",
"filename" : "AppIcon1024x1024.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"

4
package Normal file → Executable file
View file

@ -2,4 +2,6 @@
cd "`dirname "$0"`"/.dragonruby
cp -R ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/
cp -R ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/
exec ./dragonruby-publish --only-package ../🕹cube-tube
cp -R ../🕹cube-tube ./cube-tube
exec ./dragonruby-publish --only-package cube-tube
rmdir -R ./cube-tube

View file

@ -1,66 +1 @@
@echo off
cd /d %~dp0
set CurrDirName=🕹cube-tube
for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newProductCode=%%a)
for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newPackageCode=%%a)
@setlocal ENABLEEXTENSIONS
@set version=0
@for /F "tokens=*" %%A in (./metadata/game_metadata.txt) do @call :CheckForVersion "%%A"
cd .dragonruby
robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/AppIcon.appiconset /e
robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/AppIcon.appiconset /e
@echo on
dragonruby-publish --only-package ../%CurrDirName%
@echo off
cd builds
if exist ./%CurrDirName%-windows-amd64.exe (
if exist ../../%CurrDirName%/installer/installer.vdproj (
echo "Building windows installer..."
for /F "tokens=* USEBACKQ" %%t IN (`findstr /c:"%version%" ..\..\%CurrDirName%\installer\installer.vdproj`) do (SET OldVersion=%%t)
if defined OldVersion (
echo "version already the same"
) else (
echo "need to update version & product/package codes (%version%, %newProductCode%, %newPackageCode%)"
powershell -Command "(Get-Content ../../%CurrDirName%/installer/installer.vdproj) | Foreach-Object { $_ -replace '""""ProductCode"""" = """"8:\{.*\}""""$', '""""ProductCode"""" = """"8:{%newProductCode%}""""' -replace '""""PackageCode"""" = """"8:\{.*\}""""$', '""""PackageCode"""" = """"8:{%newPackageCode%}""""' -replace '""""ProductVersion"""" = """"8:.+""""$', '""""ProductVersion"""" = """"8:%version%""' } | Out-File -encoding UTF8 ../../%CurrDirName%/installer/installer.vdproj"
)
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" ..\..\%CurrDirName%\installer\installer.sln /build Release
) else (
ECHO "no installer project?"
ECHO ../../%CurrDirName%/installer/installer.vdproj
)
) else (
ECHO "no exe?"
ECHO ./%CurrDirName%-windows-amd64.exe
)
if not exist ./%CurrDirName%.keystore (
echo "no keystore, generating keys"
keytool -genkey -v -keystore %CurrDirName%.keystore -alias %CurrDirName% -keyalg RSA -keysize 2048 -validity 10000
)
if exist ./%CurrDirName%-android.apk (
echo "Signing apk..."
call "C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\apksigner.bat" sign -ks %CurrDirName%.keystore %CurrDirName%-android.apk
echo "Signing aab..."
call jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore %CurrDirName%.keystore %CurrDirName%-googleplay.aab %CurrDirName%
) else (
ECHO "no apk?"
ECHO ./%CurrDirName%-android.apk
)
ECHO "All done!"
explorer.exe %cd%
PAUSE
@exit /b 0
:CheckForVersion
@set _line=%~1
@set _linePrefeix=%_line:~0,8%
@if "%_linePrefeix%" equ "version=" (@set version="%_line:~8%")
@exit /b 0
call publish.bat --only-package

72
publish.bat Normal file
View file

@ -0,0 +1,72 @@
@echo off
chcp 65001 >NUL
cd /d %~dp0
set gamedir=🕹cube-tube
for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newProductCode=%%a)
for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newPackageCode=%%a)
@setlocal ENABLEEXTENSIONS
@set version=0
@for /F "tokens=*" %%A in (%gamedir%/metadata/game_metadata.txt) do @call :CheckForVersion "%%A"
cd .dragonruby
robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/AppIcon.appiconset /e
robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/AppIcon.appiconset /e
robocopy ../%gamedir% ./%gameid% /e
@echo on
dragonruby-publish %* %gameid%
@echo off
rd /s /q %gameid%
cd builds
if exist ./%gameid%-windows-amd64.exe (
if exist ../../installer/installer.vdproj (
echo "Building windows installer..."
for /F "tokens=* USEBACKQ" %%t IN (`findstr /c:"%version%" ..\..\installer\installer.vdproj`) do (SET OldVersion=%%t)
if defined OldVersion (
echo "version already the same"
) else (
echo "need to update version & product/package codes (%version%, %newProductCode%, %newPackageCode%)"
powershell -Command "(Get-Content ../../installer/installer.vdproj) | Foreach-Object { $_ -replace '""""ProductCode"""" = """"8:\{.*\}""""$', '""""ProductCode"""" = """"8:{%newProductCode%}""""' -replace '""""PackageCode"""" = """"8:\{.*\}""""$', '""""PackageCode"""" = """"8:{%newPackageCode%}""""' -replace '""""ProductVersion"""" = """"8:.+""""$', '""""ProductVersion"""" = """"8:%version%""' } | Out-File -encoding UTF8 ../../installer/installer.vdproj"
)
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" ..\..\installer\installer.sln /build Release
) else (
ECHO "no installer project?"
ECHO ../../installer/installer.vdproj
)
) else (
ECHO "no exe?"
ECHO ./%gameid%-windows-amd64.exe
)
if not exist ../../%gameid%.keystore (
echo "no keystore, generating keys"
keytool -genkey -v -keystore ../../%gameid%.keystore -alias %gameid% -keyalg RSA -keysize 2048 -validity 10000
)
if exist ./%gameid%-android.apk (
echo "Signing apk..."
call "C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\apksigner.bat" sign -ks ../../%gameid%.keystore %gameid%-android.apk
echo "Signing aab..."
call jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore ../../%gameid%.keystore %gameid%-googleplay.aab %gameid%
) else (
ECHO "no apk?"
ECHO ./%gameid%-android.apk
)
ECHO "All done!"
explorer.exe %cd%
PAUSE
@exit /b 0
:CheckForVersion
@set _line=%~1
@set _linePrefeix=%_line:~0,8%
@if "%_linePrefeix%" equ "version=" (@set version="%_line:~8%")
@set _linePrefeix=%_line:~0,7%
@if "%_linePrefeix%" equ "gameid=" (@set gameid="%_line:~7%")
@exit /b 0

View file

@ -0,0 +1,8 @@
{
"folders": [
{
"path": "🕹cube-tube"
}
],
"settings": {}
}

View file

@ -8,7 +8,7 @@
"name": "Run Game",
"type": "node-terminal",
"request": "launch",
"command": "${workspaceRoot}/../.dragonruby/dragonruby ${workspaceRoot}",
"command": "\"${workspaceRoot}/../.dragonruby/dragonruby\" \"${workspaceRoot}\"",
"windows": {
"command": "${workspaceRoot}/../.dragonruby/dragonruby.exe ${workspaceRoot}",
},

View file

@ -10,8 +10,31 @@ class SceneInstance
attr_reader :tick_in_background
attr_accessor :reset_on_pop
def screenshot(args)
screenshot_path = "../marketing-assets/screenshots/#{args.gtk.platform}"
now = Time.new
now_s = "#{now.year}-#{"#{now.month}".rjust(2, "0")}-#{"#{now.day}".rjust(2, "0")} at #{"#{now.hour}".rjust(2, "0")}.#{"#{now.min}".rjust(2, "0")}.#{"#{now.sec}".rjust(2, "0")}"
base_filename = "#{screenshot_path}/Screenshot - #{args.gtk.platform} - #{now_s}"
filename = "#{base_filename}.png"
count = 0
while !args.gtk.stat_file(filename).nil?
count += 1;
filename = "#{base_filename} (#{count}).png"
end
args.outputs.screenshots << {
x: 0, y: 0, w: args.grid.w, h: args.grid.h, # Which portion of the screen should be captured
path: filename, # Output path of PNG file (inside game directory)
# r: 255, g: 255, b: 255, a: 0 # Optional chroma key
}
args.gtk.notify!("Screenshot taken: '#{filename}'")
end
# called every tick of the game loop
def tick(args) end
def tick(args)
screenshot(args) if args.inputs.keyboard.ctrl_p
end
# custom logic to reset this scene
def reset(args) end

View file

@ -5,7 +5,7 @@ module Input
class << self
PRIMARY_KEYS = [:j, :z, :space]
SECONDARY_KEYS = [:k, :x, :backspace]
PAUSE_KEYS = [:escape, :p]
PAUSE_KEYS = [:escape]
BINDINGS = {
primary: {
keyboard: %i[j z space],
@ -16,7 +16,7 @@ module Input
controller_one: %i[b]
},
pause: {
keyboard: %i[escape p],
keyboard: %i[escape],
controller_one: %i[start]
},
rotate_left: {

View file

@ -36,7 +36,7 @@ class MainMenu < MenuScene
next_sec = random(20..50)
@next_announcement = args.state.tick_count + (next_sec * 60)
sound = :"ambient#{random(1..6)}"
puts sound, Sound.for(sound).input
# puts sound, Sound.for(sound).input
Sound.play(args, sound)
end

View file

@ -39,7 +39,9 @@ class MenuScene < SceneInstance
text(option[:key])
end
if (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
scramble = (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
if scramble
if args.state.tick_count % 4 == 0
@rand_strings[i] = (0...(rand(text.length >= 3 ? text.length : 3) + 3)).map { ('A'..'Z').to_a[rand(26)] }.join
end
@ -73,7 +75,7 @@ class MenuScene < SceneInstance
button_border = { w: 340, h: 80, x: l.x - 170, y: l.y - 55 }.merge(WHITE)
# (args.outputs.borders << button_border) if mobile?
if args.inputs.mouse.up && args.inputs.mouse.inside_rect?(button_border)
if args.inputs.mouse.up && args.inputs.mouse.inside_rect?(button_border) && !scramble
o = @menu_options.find { |o| o[:key] == l[:key] }
Sound.play(args, :menu)
o[:on_select].call(args) if o

View file

@ -9,6 +9,10 @@ class PauseMenu < MenuScene
key: :resume,
on_select: ->(args) { Scene.pop(args) }
},
{
key: :restart,
on_select: ->(args) { Scene.switch(args, :intro, reset: true) }
},
{
key: :settings,
on_select: ->(args) { Scene.push(args, :settings, reset: true, reset_on_pop: true) }
@ -19,12 +23,12 @@ class PauseMenu < MenuScene
}
]
if args.gtk.platform?(:desktop)
menu_options << {
key: :quit,
on_select: ->(args) { args.gtk.request_quit }
}
end
# if args.gtk.platform?(:desktop)
# menu_options << {
# key: :quit,
# on_select: ->(args) { args.gtk.request_quit }
# }
# end
super args, opts, :paused, menu_options
end

View file

@ -16,6 +16,7 @@ TEXT = {
paused: "Paused",
quit: "Quit",
resume: "Resume",
restart: "Restart",
return_to_main_menu: "Main Menu",
settings: "Settings",
sfx: "Sound Effects",

View file

@ -53,7 +53,7 @@ def debug_tick(args)
debug_label(
args, 24.from_right, 24.from_top,
"v#{version} | DR v#{$gtk.version} (#{$gtk.platform}) | Ticks: #{args.state.tick_count} | FPS: #{args.gtk.current_framerate.round}",
"v#{version} | DR v#{$gtk.version} (#{$gtk.platform}) | Ticks: #{args.state.tick_count} | FPS: #{args.gtk.current_framerate.round} | Win: #{args.grid.window_width}x#{args.grid.window_height}",
ALIGN_RIGHT)

View file

@ -23,12 +23,12 @@ module Scene
# if `scene` is not a `SceneInstance`, it's probably a symbol representing
# the scene we're switching to, so go get it.
the_scene = scene.is_a?(SceneInstance) ? scene : SCENES[scene].new(args)
puts '---'
puts 'switching to'
puts scene unless scene.is_a?(SceneInstance)
puts SCENES[scene] unless scene.is_a?(SceneInstance)
puts the_scene
puts '---'
# puts '---'
# puts 'switching to'
# puts scene unless scene.is_a?(SceneInstance)
# puts SCENES[scene] unless scene.is_a?(SceneInstance)
# puts the_scene
# puts '---'
# if the stack is empty (e.g. we just cleared it), then push this scene
args.state.scene_stack.push(the_scene) if args.state.scene_stack.empty?
@ -56,7 +56,7 @@ module Scene
scene = args.state.scene_stack.last
scene = scene._?(default(args))
reset = scene.reset_on_pop if reset.nil?
puts reset, scene, scene.reset_on_pop
# puts reset, scene, scene.reset_on_pop
switch(args, scene, reset: reset, push_or_pop: true)
end

View file

@ -2,7 +2,7 @@ devid=deathau
devtitle=death.au
gameid=cube-tube
gametitle=Cube Tube
version=0.1.0
version=0.2.1
icon=metadata/icon.png
# === Flags available at all licensing tiers ===