diff options
| author | realtradam <[email protected]> | 2024-06-27 12:41:26 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-06-27 12:41:26 -0400 |
| commit | c8be5658bae95b94198dc00bd206ba324d9404e0 (patch) | |
| tree | 24563828d9f04a4e52c9187cff3c028434fd886c /rails-backend/db | |
| parent | 8ec0664fe7cf4a34bc5fc1f162c053622a42dd41 (diff) | |
| download | gameHolster-c8be5658bae95b94198dc00bd206ba324d9404e0.tar.gz gameHolster-c8be5658bae95b94198dc00bd206ba324d9404e0.zip | |
add frontend to repo
Diffstat (limited to 'rails-backend/db')
43 files changed, 488 insertions, 0 deletions
diff --git a/rails-backend/db/lfs/Games/Almost Pong/card.png b/rails-backend/db/lfs/Games/Almost Pong/card.png Binary files differnew file mode 100644 index 0000000..aab9261 --- /dev/null +++ b/rails-backend/db/lfs/Games/Almost Pong/card.png diff --git a/rails-backend/db/lfs/Games/Almost Pong/character.png b/rails-backend/db/lfs/Games/Almost Pong/character.png Binary files differnew file mode 100644 index 0000000..8e3b3df --- /dev/null +++ b/rails-backend/db/lfs/Games/Almost Pong/character.png diff --git a/rails-backend/db/lfs/Games/Almost Pong/desc.md b/rails-backend/db/lfs/Games/Almost Pong/desc.md new file mode 100644 index 0000000..32756fd --- /dev/null +++ b/rails-backend/db/lfs/Games/Almost Pong/desc.md @@ -0,0 +1,12 @@ +# [Almost Pong](https://github.com/realtradam/almost-pong) + +## Controls +Spacebar to play + +## Tech Stack +Ruby, FelECS, and Raylib + +## Description + +Almost Pong is a silly mashup between the classic Pong and the not so classic Flappy Bird. I saw someone else make this on the internet and I decided to give myself a challenge to see if I could recreate this within a few hours and I did! + diff --git a/rails-backend/db/lfs/Games/Almost Pong/index.zip b/rails-backend/db/lfs/Games/Almost Pong/index.zip Binary files differnew file mode 100644 index 0000000..63a8a2d --- /dev/null +++ b/rails-backend/db/lfs/Games/Almost Pong/index.zip diff --git a/rails-backend/db/lfs/Games/Almost Pong/title.png b/rails-backend/db/lfs/Games/Almost Pong/title.png Binary files differnew file mode 100644 index 0000000..6ee677c --- /dev/null +++ b/rails-backend/db/lfs/Games/Almost Pong/title.png diff --git a/rails-backend/db/lfs/Games/Bubbles, Behind/card.png b/rails-backend/db/lfs/Games/Bubbles, Behind/card.png Binary files differnew file mode 100644 index 0000000..4100514 --- /dev/null +++ b/rails-backend/db/lfs/Games/Bubbles, Behind/card.png diff --git a/rails-backend/db/lfs/Games/Bubbles, Behind/character.png b/rails-backend/db/lfs/Games/Bubbles, Behind/character.png Binary files differnew file mode 100644 index 0000000..3c408c1 --- /dev/null +++ b/rails-backend/db/lfs/Games/Bubbles, Behind/character.png diff --git a/rails-backend/db/lfs/Games/Bubbles, Behind/desc.md b/rails-backend/db/lfs/Games/Bubbles, Behind/desc.md new file mode 100644 index 0000000..90f0975 --- /dev/null +++ b/rails-backend/db/lfs/Games/Bubbles, Behind/desc.md @@ -0,0 +1,20 @@ +# [Bubbles, Behind](https://github.com/realtradam/TOJam2023) + +## Controls + +### Keyboard +- WASD - Movement + +### Controller +Left Joystick - Movement + +## Tech Stack +C and a home-made custom game engine with BGFX + +## Description + +This game was made in 3 days with the collaboration of my friend [Arnold](https://github.com/arngo). We set out to build a game with my woefully unprepared prototype game engine and managed to stick the landing! + +I really enjoy the story on this project because halfway through the project the game engine unexpected brought up a massive bug which made the game entirely unplayable. Luckily through my knowledge of rendering and how I had built up my engine I was able to pinpoint the issue and resolve it before the tight deadline. + +The second interesting thing that happened was a bug which would randomly crash the game after an indeterminate amount of time. This bug had been discovered mere minutes before the deadline however we were able to cover up the bug to players of the game in a very clever way. We set up a bash script which would run in a loop and this script would sleep for a couple seconds and then launch the game. Why would we have a delay to relaunch the game? We set up a full screen window on the PC of an image saying "Game Over". Whenever the game would crash this image would immediately become visible, the players would see it and incorrectly assume they had "died" in the game and then the game would relaunch. The game would launch also in fullscreen so it would go on top of this image. And so no one was aware at all of any bug or crash happening. Hilarious. diff --git a/rails-backend/db/lfs/Games/Bubbles, Behind/index.zip b/rails-backend/db/lfs/Games/Bubbles, Behind/index.zip Binary files differnew file mode 100644 index 0000000..661dac6 --- /dev/null +++ b/rails-backend/db/lfs/Games/Bubbles, Behind/index.zip diff --git a/rails-backend/db/lfs/Games/Bubbles, Behind/title.png b/rails-backend/db/lfs/Games/Bubbles, Behind/title.png Binary files differnew file mode 100644 index 0000000..718918a --- /dev/null +++ b/rails-backend/db/lfs/Games/Bubbles, Behind/title.png diff --git a/rails-backend/db/lfs/Games/Magnet Run/card.png b/rails-backend/db/lfs/Games/Magnet Run/card.png Binary files differnew file mode 100644 index 0000000..5a942da --- /dev/null +++ b/rails-backend/db/lfs/Games/Magnet Run/card.png diff --git a/rails-backend/db/lfs/Games/Magnet Run/character.png b/rails-backend/db/lfs/Games/Magnet Run/character.png Binary files differnew file mode 100644 index 0000000..beb1fbe --- /dev/null +++ b/rails-backend/db/lfs/Games/Magnet Run/character.png diff --git a/rails-backend/db/lfs/Games/Magnet Run/desc.md b/rails-backend/db/lfs/Games/Magnet Run/desc.md new file mode 100644 index 0000000..7d75d1e --- /dev/null +++ b/rails-backend/db/lfs/Games/Magnet Run/desc.md @@ -0,0 +1,16 @@ +# [Magnet Run](https://github.com/realtradam/Magnet-Run-3D) + +## Controls + +- WASD - Movement +- Space - Jump +- Q/E - Rotate camera horizontally(disables auto rotation for a short time) +- Z/X - Rotate camera vertically(disables auto rotation for a short time) + +## Tech Stack +Unity, C# + +## Description + +A 3D Unity game I had created to learn and practice creating a character controller and camera as well as learning how to create a platformer system similar to Super Mario Galaxy where the gravity can be in any direction. + diff --git a/rails-backend/db/lfs/Games/Magnet Run/index.zip b/rails-backend/db/lfs/Games/Magnet Run/index.zip Binary files differnew file mode 100644 index 0000000..4164abe --- /dev/null +++ b/rails-backend/db/lfs/Games/Magnet Run/index.zip diff --git a/rails-backend/db/lfs/Games/Magnet Run/title.png b/rails-backend/db/lfs/Games/Magnet Run/title.png Binary files differnew file mode 100644 index 0000000..b272849 --- /dev/null +++ b/rails-backend/db/lfs/Games/Magnet Run/title.png diff --git a/rails-backend/db/lfs/Games/Optimal Direction/card.png b/rails-backend/db/lfs/Games/Optimal Direction/card.png Binary files differnew file mode 100644 index 0000000..ff6223f --- /dev/null +++ b/rails-backend/db/lfs/Games/Optimal Direction/card.png diff --git a/rails-backend/db/lfs/Games/Optimal Direction/character.png b/rails-backend/db/lfs/Games/Optimal Direction/character.png Binary files differnew file mode 100644 index 0000000..1fd4e20 --- /dev/null +++ b/rails-backend/db/lfs/Games/Optimal Direction/character.png diff --git a/rails-backend/db/lfs/Games/Optimal Direction/desc.md b/rails-backend/db/lfs/Games/Optimal Direction/desc.md new file mode 100644 index 0000000..90febb6 --- /dev/null +++ b/rails-backend/db/lfs/Games/Optimal Direction/desc.md @@ -0,0 +1,18 @@ +# Optimal Direction + +## Controls +- W - Accelerate +- A/D - Steering +- Shift - Drift/Grip +- Space: Brake + +## Tech Stack +Godot + +## Description + +An old overly ambitious project of mine. The goal was to make a sort of realistic 2d racing game where the physics took into account things like weight distribution, front/rear/all wheel drive, gearboxes, etc. + +A lot of those mechanics were implemented, but the scope of the project was much too big for one person at the skill level I was at to realistically finish the project so for that reason it was abandoned. + +I hope to one day revisit this genre again and make a fun game out of it. diff --git a/rails-backend/db/lfs/Games/Optimal Direction/index.zip b/rails-backend/db/lfs/Games/Optimal Direction/index.zip Binary files differnew file mode 100644 index 0000000..4f169ec --- /dev/null +++ b/rails-backend/db/lfs/Games/Optimal Direction/index.zip diff --git a/rails-backend/db/lfs/Games/Optimal Direction/title.png b/rails-backend/db/lfs/Games/Optimal Direction/title.png Binary files differnew file mode 100644 index 0000000..d155fd7 --- /dev/null +++ b/rails-backend/db/lfs/Games/Optimal Direction/title.png diff --git a/rails-backend/db/lfs/Games/Orc: Arena of Time/card.png b/rails-backend/db/lfs/Games/Orc: Arena of Time/card.png Binary files differnew file mode 100644 index 0000000..c757a53 --- /dev/null +++ b/rails-backend/db/lfs/Games/Orc: Arena of Time/card.png diff --git a/rails-backend/db/lfs/Games/Orc: Arena of Time/character.png b/rails-backend/db/lfs/Games/Orc: Arena of Time/character.png Binary files differnew file mode 100644 index 0000000..2e46e51 --- /dev/null +++ b/rails-backend/db/lfs/Games/Orc: Arena of Time/character.png diff --git a/rails-backend/db/lfs/Games/Orc: Arena of Time/desc.md b/rails-backend/db/lfs/Games/Orc: Arena of Time/desc.md new file mode 100644 index 0000000..8072a4e --- /dev/null +++ b/rails-backend/db/lfs/Games/Orc: Arena of Time/desc.md @@ -0,0 +1,15 @@ +# [Orc: Arena of Time](https://github.com/realtradam/orc-arena-of-time) + +## Controls +- WASD - Movement + +## Tech Stack +Ruby, FelECS, and Raylib + +## Description + +Help "Orc", the brave orc, navigate the precarious Arena of Time and prove to all what a mighty adventurer they are! + +In my opinion the best game I have made so far and the one I am the most proud of. It has the most unique gameplay out of all the games I have worked on and a great considerable amount of effort went into this. + +It also won first place overall in the [Raylib 5K gamejam](https://itch.io/jam/raylib-5k-gamejam) which is awesome! diff --git a/rails-backend/db/lfs/Games/Orc: Arena of Time/index.zip b/rails-backend/db/lfs/Games/Orc: Arena of Time/index.zip Binary files differnew file mode 100644 index 0000000..b29fb85 --- /dev/null +++ b/rails-backend/db/lfs/Games/Orc: Arena of Time/index.zip diff --git a/rails-backend/db/lfs/Games/Orc: Arena of Time/title.png b/rails-backend/db/lfs/Games/Orc: Arena of Time/title.png Binary files differnew file mode 100644 index 0000000..311fdb4 --- /dev/null +++ b/rails-backend/db/lfs/Games/Orc: Arena of Time/title.png diff --git a/rails-backend/db/lfs/Games/SpaceCube 64/card.png b/rails-backend/db/lfs/Games/SpaceCube 64/card.png Binary files differnew file mode 100644 index 0000000..2363c7f --- /dev/null +++ b/rails-backend/db/lfs/Games/SpaceCube 64/card.png diff --git a/rails-backend/db/lfs/Games/SpaceCube 64/character.png b/rails-backend/db/lfs/Games/SpaceCube 64/character.png Binary files differnew file mode 100644 index 0000000..11257b7 --- /dev/null +++ b/rails-backend/db/lfs/Games/SpaceCube 64/character.png diff --git a/rails-backend/db/lfs/Games/SpaceCube 64/desc.md b/rails-backend/db/lfs/Games/SpaceCube 64/desc.md new file mode 100644 index 0000000..099657c --- /dev/null +++ b/rails-backend/db/lfs/Games/SpaceCube 64/desc.md @@ -0,0 +1,32 @@ +# [Space Cube 64](https://github.com/realtradam/tojam2024) + +## Controls +### Web Controls: + +#### P1: + +- WASD -> movement +- E -> shoot +- Q -> change camera(thirdperson or firstperson) + +#### P2: +- IJKL -> movement +- O -> shoot +- U -> change camera(thirdperson or firstperson) + + + +### N64 Controls: + +- Joystick -> movement +- Z -> shoot +- R -> change camera(thirdperson or firstperson) + +## Tech Stack +Nintendo 64, C, Libdragon, Raylib + +## Description + +An entry into the Toronto Gamejam 2024, this game was developed for real Nintendo 64 hardware and for the game showcase we demoed the game running on a real Nintendo 64. + +Later we ported this game to the web which is what you can see above and play. It runs significantly better on the web, on the Nintendo the framerate would drop as low at 10fps. diff --git a/rails-backend/db/lfs/Games/SpaceCube 64/index.zip b/rails-backend/db/lfs/Games/SpaceCube 64/index.zip Binary files differnew file mode 100644 index 0000000..ce01311 --- /dev/null +++ b/rails-backend/db/lfs/Games/SpaceCube 64/index.zip diff --git a/rails-backend/db/lfs/Games/SpaceCube 64/title.png b/rails-backend/db/lfs/Games/SpaceCube 64/title.png Binary files differnew file mode 100644 index 0000000..9f306a3 --- /dev/null +++ b/rails-backend/db/lfs/Games/SpaceCube 64/title.png diff --git a/rails-backend/db/lfs/Games/Winter One/card.png b/rails-backend/db/lfs/Games/Winter One/card.png Binary files differnew file mode 100644 index 0000000..d15bc1b --- /dev/null +++ b/rails-backend/db/lfs/Games/Winter One/card.png diff --git a/rails-backend/db/lfs/Games/Winter One/character.png b/rails-backend/db/lfs/Games/Winter One/character.png Binary files differnew file mode 100644 index 0000000..24cfdb1 --- /dev/null +++ b/rails-backend/db/lfs/Games/Winter One/character.png diff --git a/rails-backend/db/lfs/Games/Winter One/desc.md b/rails-backend/db/lfs/Games/Winter One/desc.md new file mode 100644 index 0000000..e392807 --- /dev/null +++ b/rails-backend/db/lfs/Games/Winter One/desc.md @@ -0,0 +1,13 @@ +# Winter One + +## Controls +Mouse + Click + +## Tech Stack +Godot + +## Description + +An old game which we republished onto Itch. This is the first game [Arnold](https://github.com/arngo) and myself have worked on together. Its a pretty simple endless scrolling shooter with 2 different enemy types. We could of developed more but we decided to instead try and move on to a different game. It was supposed to be a short 1-2 week project that ended up taking over 3 weeks to finish. This was mostly a project about learning the ins and and outs of the Godot Engine and also to try an manage a short deadline(winter break). + + diff --git a/rails-backend/db/lfs/Games/Winter One/index.zip b/rails-backend/db/lfs/Games/Winter One/index.zip Binary files differnew file mode 100644 index 0000000..01eb869 --- /dev/null +++ b/rails-backend/db/lfs/Games/Winter One/index.zip diff --git a/rails-backend/db/lfs/Games/Winter One/title.png b/rails-backend/db/lfs/Games/Winter One/title.png Binary files differnew file mode 100644 index 0000000..a654725 --- /dev/null +++ b/rails-backend/db/lfs/Games/Winter One/title.png diff --git a/rails-backend/db/migrate/20240519191604_create_users.rb b/rails-backend/db/migrate/20240519191604_create_users.rb new file mode 100644 index 0000000..d1fa192 --- /dev/null +++ b/rails-backend/db/migrate/20240519191604_create_users.rb @@ -0,0 +1,13 @@ +class CreateUsers < ActiveRecord::Migration[7.1] + def change + create_table :users do |t| + t.string :user_name # we need this for game urls + t.string :identifier + t.string :access_token_digest + t.json :user_data + + t.timestamps + end + #add_index :users, :identifier, unique: true + end +end diff --git a/rails-backend/db/migrate/20240521142838_create_active_storage_tables.active_storage.rb b/rails-backend/db/migrate/20240521142838_create_active_storage_tables.active_storage.rb new file mode 100644 index 0000000..e4706aa --- /dev/null +++ b/rails-backend/db/migrate/20240521142838_create_active_storage_tables.active_storage.rb @@ -0,0 +1,57 @@ +# This migration comes from active_storage (originally 20170806125915) +class CreateActiveStorageTables < ActiveRecord::Migration[7.0] + def change + # Use Active Record's configured type for primary and foreign keys + primary_key_type, foreign_key_type = primary_and_foreign_key_types + + create_table :active_storage_blobs, id: primary_key_type do |t| + t.string :key, null: false + t.string :filename, null: false + t.string :content_type + t.text :metadata + t.string :service_name, null: false + t.bigint :byte_size, null: false + t.string :checksum + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :key ], unique: true + end + + create_table :active_storage_attachments, id: primary_key_type do |t| + t.string :name, null: false + t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type + t.references :blob, null: false, type: foreign_key_type + + if connection.supports_datetime_with_precision? + t.datetime :created_at, precision: 6, null: false + else + t.datetime :created_at, null: false + end + + t.index [ :record_type, :record_id, :name, :blob_id ], name: :index_active_storage_attachments_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + + create_table :active_storage_variant_records, id: primary_key_type do |t| + t.belongs_to :blob, null: false, index: false, type: foreign_key_type + t.string :variation_digest, null: false + + t.index [ :blob_id, :variation_digest ], name: :index_active_storage_variant_records_uniqueness, unique: true + t.foreign_key :active_storage_blobs, column: :blob_id + end + end + + private + def primary_and_foreign_key_types + config = Rails.configuration.generators + setting = config.options[config.orm][:primary_key_type] + primary_key_type = setting || :primary_key + foreign_key_type = setting || :bigint + [primary_key_type, foreign_key_type] + end +end diff --git a/rails-backend/db/migrate/20240521205000_create_games.rb b/rails-backend/db/migrate/20240521205000_create_games.rb new file mode 100644 index 0000000..d65b118 --- /dev/null +++ b/rails-backend/db/migrate/20240521205000_create_games.rb @@ -0,0 +1,16 @@ +class CreateGames < ActiveRecord::Migration[7.1] + def change + create_table :games do |t| + t.string :title + t.string :titleSlug + t.string :description + t.string :github_link + t.string :img_rendering + t.integer :status, default: 0 + t.integer :order, default: 0 + + t.timestamps + end + add_reference :games, :user, null: false, foreign_key: true + end +end diff --git a/rails-backend/db/migrate/20240527231908_add_path_to_active_storage_blobs.rb b/rails-backend/db/migrate/20240527231908_add_path_to_active_storage_blobs.rb new file mode 100644 index 0000000..c591ae1 --- /dev/null +++ b/rails-backend/db/migrate/20240527231908_add_path_to_active_storage_blobs.rb @@ -0,0 +1,5 @@ +class AddPathToActiveStorageBlobs < ActiveRecord::Migration[7.1] + def change + add_column :active_storage_blobs, :filepath, :string, null: false, default: '' + end +end diff --git a/rails-backend/db/migrate/20240606184819_create_tags.rb b/rails-backend/db/migrate/20240606184819_create_tags.rb new file mode 100644 index 0000000..9b33939 --- /dev/null +++ b/rails-backend/db/migrate/20240606184819_create_tags.rb @@ -0,0 +1,10 @@ +class CreateTags < ActiveRecord::Migration[7.1] + def change + create_table :tags do |t| + t.string :tag_type, null: false + t.string :name, null: false + + t.timestamps + end + end +end diff --git a/rails-backend/db/migrate/20240606200659_create_tags_games_join_table.rb b/rails-backend/db/migrate/20240606200659_create_tags_games_join_table.rb new file mode 100644 index 0000000..7a0dae4 --- /dev/null +++ b/rails-backend/db/migrate/20240606200659_create_tags_games_join_table.rb @@ -0,0 +1,8 @@ +class CreateTagsGamesJoinTable < ActiveRecord::Migration[7.1] + def change + create_join_table :tags, :games do |t| + t.index :tag_id + t.index :game_id + end + end +end diff --git a/rails-backend/db/schema.rb b/rails-backend/db/schema.rb new file mode 100644 index 0000000..f4cabcc --- /dev/null +++ b/rails-backend/db/schema.rb @@ -0,0 +1,86 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema[7.1].define(version: 2024_06_06_200659) do + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "active_storage_attachments", force: :cascade do |t| + t.string "name", null: false + t.string "record_type", null: false + t.bigint "record_id", null: false + t.bigint "blob_id", null: false + t.datetime "created_at", null: false + t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" + t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true + end + + create_table "active_storage_blobs", force: :cascade do |t| + t.string "key", null: false + t.string "filename", null: false + t.string "content_type" + t.text "metadata" + t.string "service_name", null: false + t.bigint "byte_size", null: false + t.string "checksum" + t.datetime "created_at", null: false + t.string "filepath", default: "", null: false + t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true + end + + create_table "active_storage_variant_records", force: :cascade do |t| + t.bigint "blob_id", null: false + t.string "variation_digest", null: false + t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true + end + + create_table "games", force: :cascade do |t| + t.string "title" + t.string "titleSlug" + t.string "description" + t.string "github_link" + t.string "img_rendering" + t.integer "status", default: 0 + t.integer "order", default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.bigint "user_id", null: false + t.index ["user_id"], name: "index_games_on_user_id" + end + + create_table "games_tags", id: false, force: :cascade do |t| + t.bigint "tag_id", null: false + t.bigint "game_id", null: false + t.index ["game_id"], name: "index_games_tags_on_game_id" + t.index ["tag_id"], name: "index_games_tags_on_tag_id" + end + + create_table "tags", force: :cascade do |t| + t.string "tag_type", null: false + t.string "name", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "users", force: :cascade do |t| + t.string "user_name" + t.string "identifier" + t.string "access_token_digest" + t.json "user_data" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" + add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" + add_foreign_key "games", "users" +end diff --git a/rails-backend/db/seeds.rb b/rails-backend/db/seeds.rb new file mode 100644 index 0000000..50c901e --- /dev/null +++ b/rails-backend/db/seeds.rb @@ -0,0 +1,167 @@ +# This file should ensure the existence of records required to run the application in every environment (production, +# development, test). The code here should be idempotent so that it can be executed at any point in every environment. +# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). +# +# Example: +# +# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| +# MovieGenre.find_or_create_by!(name: genre_name) +# end + +markdown_sample = <<~HEREDOC +# Telum vim lactente + +## Petebam Circe hic mactare vitae tandem super + +Lorem markdownum Perseu tetigisse instar. Negat inde calidi sibi, in ora +sanguine; vox excitus pes, in in tibi mella! Portasse morte hic venit, latebras +varios servire libera; hic ad augusta forcipe, *illis* est ubi atque. + +Veri inquit pondere. Precatur ego Amymonen quae vidit lunares caput, nequeo, et. +Occidat in nosset pressa, nomine exercita penitus viae gaudent extemplo. +Mensuraque imitamine primum: sine est suas, quo in, est falso est accingere +ibimus ore renuente. Trahit sua nulla per ut vestigia celerique, gemit manes, +quo suae. + +``` +if (graphic_veronica_traceroute + scanRdram < bittorrent_dtd + + bugWindowsOrientation) { + pitchWord = dllTrackbackRemote; + jquery.batchDot.megabyte(cookie - public, memoryDslamSlashdot(2, + socialPpcEncryption)); +} +cron_analyst = ddr_zettabyte_mips; +var digitize = 1; +var friend_gui = artificial.system(alphaWebsite + domain_ibm( + install_ospf_definition, mca_camelcase, 4), 551649, active_trinitron( + microcomputer_spoofing)); +``` + +Ungues in cannae limumque ingrate; in una voce cubitoque fecit. Non nec, uno +vires laesit perque carpere vultus armenta. Via [praetulit clipei +vestis](http://antro.net/) vidit, sive vestes invitas pro ad per nato nam beati. + +## Nec hauriret stantis + +Illa serpentem fugit inlaesas, cum spoliis vultum arbitrium penates fulmina +caelestia moriens videt insidias. Umidus positi, et ripis feremur sit capit +detur tenens. + +- Provolat cum ecce dextro sed suum pomi +- Voce falsa habuit te +- Modo deponere bracchia pectus + +Deus canor incurva usu dolisque tuentes, leto Liber iniquae requies declivis ad +fontibus tali, flagratque aquaticus. Rupit stimuloque, conscia, nimiumque ait +nomen est Libycas, undas. + +> Humumque spectata et vera, **rugosis causam** iaculo sacra, iunctas rege +> triplices contrahit. Potenti unum cava fama genitor testata summa. Comae sit +> cum, dignissima tauri, formatus promissis *in* quoque [quem +> candidaque](http://sulcomaxima.net/), vitalesque? Pro edere rescindere, premit +> mortisque celeri egredior mare pater, una. Arva tu annos fila valles nocte, +> sero deum densetur **soror siccatque Aeacide** certe undique discordia latent +> et. + +Mihi aureus. Eque tuo, illam diris, virgineas erit externis stabula saetae datis +videat vultus depositae nymphas pedum non peto quem. +HEREDOC + +platform_tags = [ + "web", + "web-desktop", + "web-mobile", + "desktop", + "mobile", + "nintendo 64", + "other" +] +platform_tags.each do |tag| + Tag.find_or_create_by!(name: tag, tag_type: "platform") +end + +game_tags = [ + "unity", + "godot", + "raylib", + "c", + "ruby", + "action", + "tech demo", + "idk something", +] +game_tags.each do |tag| + Tag.find_or_create_by!(name: tag, tag_type: "game") +end + +user = User.find_or_create_by!(user_name: "realtradam", identifier: "11139432") + +data_dir = Rails.root.join('db/lfs') + +games = [ + { + title: 'Almost Pong', + github_link: 'https://github.com/realtradam/almost-pong', + img_rendering: 'crisp-edges', + tags: ["web-desktop"] + }, + { + title: 'Bubbles, Behind', + github_link: 'https://github.com/realtradam/TOJam2023', + img_rendering: 'crisp-edges', + tags: ["web-desktop", "desktop"] + }, + { + title: 'Magnet Run', + github_link: 'https://github.com/realtradam/Magnet-Run-3D', + img_rendering: 'crisp-edges', + tags: ["web-desktop", "desktop"] + }, + { + title: 'Optimal Direction', + github_link: 'https://github.com/realtradam/optimal-direction', + img_rendering: 'crisp-edges', + tags: ["web-desktop", "desktop"] + }, + { + title: 'Winter One', + github_link: '', + img_rendering: 'pixelated', + tags: ["web-desktop", "desktop"] + }, + { + title: 'SpaceCube 64', + github_link: 'https://github.com/realtradam/tojam2024', + img_rendering: 'crisp-edges', + tags: ["nintendo 64", "web-desktop"] + }, + { + title: 'Orc: Arena of Time', + github_link: 'https://github.com/realtradam/orc-arena-of-time', + img_rendering: 'pixelated', + tags: ["web-desktop", "desktop"] + }, +] + +games.each do |game| + next if Game.exists?(title: game[:title], user_id: 1) # first user is always me + tags = game[:tags] + game.delete(:tags) + game[:description] = File.read("#{data_dir}/Games/#{game[:title]}/desc.md") + game_obj = user.games.new(game) + game_obj.save_zip("#{data_dir}/Games/#{game[:title]}/index.zip") + game_obj.card_img.attach(io: File.open("#{data_dir}/Games/#{game[:title]}/card.png"), filename: 'card.png') + game_obj.char_img.attach(io: File.open("#{data_dir}/Games/#{game[:title]}/character.png"), filename: 'character.png') + game_obj.title_img.attach(io: File.open("#{data_dir}/Games/#{game[:title]}/title.png"), filename: 'title.png') + game_obj.titleSlug = game[:title].parameterize + game_obj.status = 1 + + tags.each do |tag| + tag_obj = Tag.find_by(tag_type: "platform", name: tag) + if tag_obj + game_obj.tags << tag_obj + end + end + + game_obj.save +end |
