Compare commits

..

No commits in common. "main" and "0.1.0" have entirely different histories.
main ... 0.1.0

164 changed files with 243 additions and 472 deletions

@ -1 +0,0 @@
Subproject commit 57ccb75151e4133e18e64fe42f07e1a4a676026b

1
.gitattributes vendored
View file

@ -1 +0,0 @@
🕹cube-tube/sprites/menu_l.png filter=lfs diff=lfs merge=lfs -text

4
.gitmodules vendored
View file

@ -1,4 +0,0 @@
[submodule ".dragonruby"]
path = .dragonruby
url = ssh://git@forge.death.id.au:2222/death.au/dragonruby-base.git
tag = 5.1

View file

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

120
README.md
View file

@ -1,24 +1,108 @@
# Cube Tube
_Tetrominoes on a Train!_
![Feature Image](./marketing-assets/feature_w.png)
# Scale
This is my first DragonRuby game project. It's basically a Tetris clone, after following these tutorials:
1. Building Tetris - Part 1: https://youtu.be/xZMwRSbC4rY
2. Building Tetris - Part 2: https://youtu.be/C3LLzDUDgz4
![repeating red dragon scale pixel art](https://user-images.githubusercontent.com/928367/204090457-0d096cbe-21cc-4753-9c63-f7786d165cfa.png)
Then making a whole bunch of modifications, including graphics, sounds, music, rotating the whole thing on its side and more.
**Simple DragonRuby Game Toolkit Game Starter Template**
It also made use of the [Scale Framework](https://github.com/DragonRidersUnite/scale), which itself got heavily modified and is mostly unrecognisable now.
Status: usable but not yet stable! This is pre-v1 software.
## DragonRuby
DragonRuby binaries, etc are in a git submodule under the `.dragonruby` folder
Quickly start a new DragonRuby Game Toolkit game with useful conventions and helpful extensions.
To update DragonRuby, update the `tag` value in `.gitmodules` then run the following git commands:
```
git submodule sync
git submodule foreach --recursive 'git fetch --tags'
git submodule update --init --recursive --remote
```
(or just dump the files in the .dragonruby folder)
Looking for a simpler version? Check out [the `simple` release](https://github.com/DragonRidersUnite/scale/releases/tag/simple) that's just `app/main.rb` with some constants and helper methods.
Also, for iOS, make sure to create icons in `marketing-assets/AppIcon.appiconset/` (see the `.gitkeep` file in that folder for more info). The `run` and `package` scripts should copy these to the correct locations in `.dragonruby/dragonruby-ios-simulator.app/Assets.xcassets/AppIcon.appiconset/` and `.dragonruby/dragonruby-ios.app/Assets.xcassets/AppIcon.appiconset` respectively.
[Check out the CHANGELOG for the summary of recent changes!](https://github.com/DragonRidersUnite/scale/wiki/CHANGELOG)
## Bugs / Features
Last tested against DragonRuby Game Toolkit v4.3.
- Functional approach to the code, namespaced in modules
- Use the DragonRuby GTK methods and data structures you know and love
- Driven by `args.state`
- Menus and pause screen
- Sensible default controls
- Defined location for where to put scenes
- Settings that persist to disk
- Displays framerate in the upper-right hand corner of the game when running in development mode
- `#debug?` helper to easily check if the game is running in development mode; useful for custom commands
- `#mobile?` to easily check when on mobile and <kbd>M</kbd> to simulate mobile
- Reload all sprites in development using the `i` key
- Reset the game with `r` key, calls `$gtk.reset`
- Put all debug-only code in `#debug_tick`
- `#init` method that gets run once on game boot
- `#version` to get the version of your game
- Constants for various values and enums: `FPS`, `BLEND_*`, `ALIGN_*`
- Tests for the methods!
- See more in [SCALE_DOCS.md](./SCALE_DOCS.md)
## Use It
There are two main ways you can use the Scale template for your games.
[📺 Video demo showing how to get started](https://www.youtube.com/watch?v=eek3a3aO-zo)
### Download the Zip
The fastest way to get started is to download the template zip file and put it into your unzipped DragonRuby Game Toolkit folder.
1. Download and unzip the DragonRuby Game Toolkit engine zip
2. Delete the `mygame` directory
3. [Download Scale](https://github.com/DragonRidersUnite/scale/archive/refs/heads/main.zip)
4. Unzip the `scale-main.zip`
5. Move the `scale-main` folder into the DRGTK folder
6. Rename `scale-main` to `mygame`
7. Start DragonRuby, and make an awesome game!
### Use GitHub's Template System
If you're going to track your game with Git and use GitHub, the baked-in template system will get you going quickly.
1. View the project on GitHub: https://github.com/DragonRidersUnite/scale
2. Click "Use this template"
3. Click "Create a new repository"
4. Fill out the details and create the repository
5. Unzip the DragonRuby Game Toolkit engine zip
6. Delete the `mygame` directory
7. Clone your new repository into the DRGTK engine folder with the folder name `mygame`, example: `git clone git@github.com:USERNAME/REPO.git mygame`
7. Start DragonRuby, and make an awesome game!
### Updating
Because Scale is a template with all of its source as part of your game, updating the framework's source code in your game isn't an easy thing to do.
I generally would say: don't worry about it! Take ownership over the code in your game and change what Scale provides you without concern. When it comes time to start your next game, Scale will be updated and improved.
But if you do find yourself wanting to keep it updated, [watch the GitHub repo](https://github.com/DragonRidersUnite/scale) for releases. You could pull in just the changes you want. Or you could set an upstream in your repo to the template and merge the changes in.
## Documentation
Every game that uses Scale comes with the [SCALE_DOCS.md](./SCALE_DOCS.md) file. Read through that document to find a quickstart guide and information about useful methods.
## Release Approach & Versioning
Code on the `main` branch is intended to be stable because Scale is a template. When significant changes have been made, a tag and release are created. This allows progress to be tracked and previous versions to be easily downloaded.
Scale uses a simplified major.minor versioning scheme. Major version bumps means there are breaking changes to the API (the methods and structure). Minor bumps mean non-breaking additions and fixes.
## Template License
The template source code falls under the [Unlicense](https://unlicense.org/), meaning it is dedicated to the public domain and you are free to do with it what you want.
## Contribute
Conributions are welcome!
Open an issue or submit PRs if you notice something isn't working.
If you find yourself adding the same files, methods, constants, etc. to your DRGTK games, submit a PR to add it to Scale.
---
[Clear out what's above in this README out and add your own details for making your game!]
## Debug Shortcuts
- <kbd>0</kbd> — display debug details (ex: framerate)
- <kbd>i</kbd> — reload sprites from disk
- <kbd>r</kbd> — reset the entire game state
- <kbd>m</kbd> — toggle mobile simulation

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
# class to represent scenes
class SceneInstance
def initialize(_args, opts = {})
@tick_in_background = opts.tick_in_background._? false
@reset_on_pop = opts.reset_on_pop._? false
end
attr_reader :tick_in_background
attr_accessor :reset_on_pop
# called every tick of the game loop
def tick(args) end
# custom logic to reset this scene
def reset(args) end
end

View file

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

View file

@ -123,18 +123,8 @@ class CubeTubeGame < GameplayScene
end
@bg_x %= @bg_w if @bg_x >= @bg_w
dirt = Sprite.for(:dirt)
10.times do |i|
dirt.render(@args, { x: @bg_x + (i * (dirt.w)), y: 0 - dirt.h + 1 })
dirt.render(@args, { x: @bg_x - (i * (dirt.w)), y: 0 - dirt.h + 1 })
dirt.render(@args, { x: @bg_x + (i * (dirt.w)), y: @args.grid.h })
dirt.render(@args, { x: @bg_x - (i * (dirt.w)), y: @args.grid.h })
end
Sprite.for(:tunnel_loop).render(@args, { x: @bg_x + @bg_w, y: 0, w: @bg_w, h: 720 })
Sprite.for(:tunnel_loop).render(@args, { x: @bg_x, y: 0, w: @bg_w, h: 720 })
Sprite.for(:tunnel_loop).render(@args, { x: @bg_x - @bg_w, y: 0, w: @bg_w, h: 720 })
Sprite.for(:tunnel_loop).render(@args, { x: @bg_x - (@bg_w * 2), y: 0, w: @bg_w, h: 720 })
# @grid_y = ((1280 - (@grid_h * @blocksize)) / 2) - 21
Sprite.for(:train).render(@args, { x: 0, y: @grid_x - 140.75 })

View file

@ -9,13 +9,11 @@ class Intro < GameplayScene
@train_spline = [
[1.0, 0.25, 0, 0]
]
@full_station_w = Sprite.for(:station_loop).w + Sprite.for(:station_end).w
@station_start_w = Sprite.for(:station_start).w
@tunnel_w = Sprite.for(:tunnel_loop).w
@full_station_start_w = @station_start_w + @tunnel_w
@full_station_start_w = Sprite.for(:station_start).w + Sprite.for(:tunnel_loop).w
@tracks_w = Sprite.for(:tracks).w
@leave_duration = 500
@leave_duration = 600
@leave_spline = [
[0, 0, 0.5, 1.0]
]
@ -42,7 +40,7 @@ class Intro < GameplayScene
@state += 1
end
when 1
@train_pos = @train_start_pos * args.easing.ease_spline(@train_start, now, @train_duration, @train_spline)
@train_pos = 1280 * args.easing.ease_spline(@train_start, now, @train_duration, @train_spline)
if @train_pos <= 0
@state += 1
@wait_start = now
@ -65,18 +63,9 @@ class Intro < GameplayScene
end
end
dirt = Sprite.for(:dirt)
dx = 0 - @full_station_start_w - @tunnel_w
while dx < @full_station_w
dirt.render(args, { x: @station_pos + dx, y: 0 - dirt.h + 1 })
dirt.render(args, { x: @station_pos + dx, y: args.grid.h })
dx += dirt.w
end
Sprite.for(:station_loop).render(args, { x: @station_pos })
Sprite.for(:station_start).render(args, { x: @station_pos - @station_start_w })
Sprite.for(:tunnel_loop).render(args, { x: @station_pos - @full_station_start_w })
Sprite.for(:tunnel_loop).render(args, { x: @station_pos - @full_station_start_w - @tunnel_w })
Sprite.for(:train).render(args, { y: 39.25, x: @train_pos })
Sprite.for(:screen).render(args, { x: @train_pos + 1024, y: 270 })
@ -109,7 +98,7 @@ class Intro < GameplayScene
@train_start = 0
@wait_start = 0
@leave_start = 0
@train_pos = @train_start_pos = 1500
@train_pos = 1280
@station_pos = 0
@screen_on = false
end

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,9 +39,7 @@ class MenuScene < SceneInstance
text(option[:key])
end
scramble = (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
if scramble
if (args.state.tick_count - @first_render) < 60 * (1.5 + i) * 0.2
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
@ -75,7 +73,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) && !scramble
if args.inputs.mouse.up && args.inputs.mouse.inside_rect?(button_border)
o = @menu_options.find { |o| o[:key] == l[:key] }
Sound.play(args, :menu)
o[:on_select].call(args) if o
@ -90,7 +88,7 @@ class MenuScene < SceneInstance
super
@first_render = args.state.tick_count if @first_render.nil?
Sprite.for(:menu_l).render(args)
Sprite.for(:menu).render(args)
args.outputs.labels << label(
@title.to_s.upcase,

View file

@ -9,10 +9,6 @@ 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) }
@ -23,12 +19,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

@ -25,10 +25,8 @@ module Sprite
screen_s3: SpriteInstance.new({ w: 250, h: 210, path: 'sprites/screen-s3.png' }),
screen_s4: SpriteInstance.new({ w: 250, h: 210, path: 'sprites/screen-s4.png' }),
menu: SpriteInstance.new({ w: 1280, h: 720, path: 'sprites/menu.png' }),
menu_l: SpriteInstance.new({ w: 2760, h: 1550, path: 'sprites/menu_l.png', x: -740, y: -415 }),
tunnel_loop: SpriteInstance.new({ w: 1358, h: 720, path: 'sprites/tunnel-loop.png' }),
tracks: SpriteInstance.new({ w: 1358, h: 55, path: 'sprites/tracks.png' }),
dirt: SpriteInstance.new({ w: 194, h: 150, path: 'sprites/dirt.png' }),
station_loop: SpriteInstance.new({ w: 1811, h: 720, path: 'sprites/station-loop.png' }),
station_start: SpriteInstance.new({ w: 618, h: 720, path: 'sprites/station-start.png' }),
station_end: SpriteInstance.new({ w: 518, h: 720, path: 'sprites/station-end.png' })

View file

@ -16,7 +16,6 @@ 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} | Win: #{args.grid.window_width}x#{args.grid.window_height}",
"v#{version} | DR v#{$gtk.version} (#{$gtk.platform}) | Ticks: #{args.state.tick_count} | FPS: #{args.gtk.current_framerate.round}",
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

Binary file not shown.

View file

@ -208,15 +208,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Cube Tube"
"ProductCode" = "8:{FAD41339-47C6-4BE0-9CE0-901208A5F92D}"
"PackageCode" = "8:{485042AA-0822-4605-9240-4B88CAAE3CCE}"
"ProductCode" = "8:{0DF427A0-5821-48F0-9CA5-B34F1123F839}"
"PackageCode" = "8:{27B06BB4-4B81-4D50-A8E0-10378563DE9D}"
"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.2.0"
"ProductVersion" = "8:0.1.1"
"Manufacturer" = "8:death.au"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"

View file

@ -1,17 +0,0 @@
Place iOS App Icon assets here, as listed below:
- icon-20pt@2x.png - 40 x 40 px
- icon-20pt@3x.png - 60 x 60 px
- icon-29pt@2x.png - 58 x 58 px
- icon-29pt@3x.png - 87 x 87 px
- icon-38pt@2x.png - 76 x 76 px
- icon-38pt@3x.png - 114 x 114 px
- icon-40pt@2x.png - 80 x 80 px
- icon-40pt@3x.png - 120 x 120 px
- icon-60pt@2x.png - 120 x 120 px
- icon-60pt@3x.png - 180 x 180 px
- icon-64pt@2x.png - 128 x 128 px
- icon-64pt@3x.png - 192 x 192 px
- icon-68pt@2x.png - 136 x 136 px
- icon-76pt@2x.png - 152 x 152 px
- icon-83.5pt@2x.png - 167 x 167 px
- icon-1024pt.png - 1024 x 1024 px

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View file

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

View file

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View file

Before

Width:  |  Height:  |  Size: 399 KiB

After

Width:  |  Height:  |  Size: 399 KiB

View file

Before

Width:  |  Height:  |  Size: 544 KiB

After

Width:  |  Height:  |  Size: 544 KiB

View file

@ -2,7 +2,7 @@ devid=deathau
devtitle=death.au
gameid=cube-tube
gametitle=Cube Tube
version=0.2.1
version=0.1.0
icon=metadata/icon.png
# === Flags available at all licensing tiers ===
@ -30,7 +30,7 @@ orientation=landscape
# HD Mode: when enabled, will give you 720p, 1080p, 1440p, 4k, and 5k rendering options
# Check out the following YouTube Video for a demo of DragonRuby's HD Capabilities
# https://youtu.be/Rnc6z84zaa4
hd=true
# hd=false
# === Texture Atlases ===
@ -42,7 +42,7 @@ hd=true
# All Screen Mode: when enabled, removes the letter box and lets you render outside of the 16:9 safe area
# NOTE: requires hd=true
allscreen=true
# allscreen=false
# All Screen Mode's Max Scale: You can specify the maximum scale for your game. Any resolution higher than your max scale will give more area outside of your resolutions safe area:
@ -70,4 +70,4 @@ allscreen=true
# allscreen_max_scale=300
# 5k: scales up to 6400x2880
allscreen_max_scale=400
# allscreen_max_scale=400

View file

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View file

Before

Width:  |  Height:  |  Size: 499 KiB

After

Width:  |  Height:  |  Size: 499 KiB

View file

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

13
package Executable file → Normal file
View file

@ -1,7 +1,8 @@
#!/bin/sh
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/
cp -R ../🕹cube-tube ./cube-tube
exec ./dragonruby-publish --only-package cube-tube
rmdir -R ./cube-tube
cd "`dirname "$0"`"
result=${PWD##*/} # to assign to a variable
result=${result:-/} # to correct for the case where PWD=/
cd ..
exec ./dragonruby-publish --only-package ${result}

View file

@ -1 +1,62 @@
call publish.bat --only-package
@echo off
cd /d %~dp0
for %%I in (.) do set CurrDirName=%%~nxI
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 ..
@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

View file

@ -1,72 +0,0 @@
@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

11
run
View file

@ -1,5 +1,8 @@
#!/bin/sh
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 ../🕹cube-tube
cd "`dirname "$0"`"
result=${PWD##*/} # to assign to a variable
result=${result:-/} # to correct for the case where PWD=/
cd ..
exec ./dragonruby ${result}

View file

@ -1,8 +1,9 @@
@echo off
cd /d %~dp0
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
for %%I in (.) do set CurrDirName=%%~nxI
cd ..
@echo on
dragonruby ../🕹cube-tube
dragonruby %CurrDirName%
EXIT /B

10
run_tests Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -e
rm -f test-failures.txt
if ! ../dragonruby . --eval app/tests.rb --no-tick --exit-on-fail; then
echo "🙀 tests failed!"
cat test-failures.txt
exit 1
else
echo "🪩 tests passed!"
fi

Some files were not shown because too many files have changed in this diff Show more