Simple gameloop utility class to use with browserify
A game loop written in typescript.
Reliable and versatile game loop implementation
Game loop for browser
```sh npm install --save extra-game-loop # or yarn add extra-game-loop ```
Game-Loop-Based Gamepad API Wrapper
Simple game loop.
PixiJS game toolkit — game loop, input, camera, vec2, splash, devtools
Game loop library.
A game loop
Canvas and interactive modules for Flexium - WebGL, keyboard, mouse, and game loop
game loop designed for node applications, not for the browser
A Skat game loop
Simple game loop
Runtime engine for Sharpee IF Platform - game loop, command execution, and turn management
a simple game loop that iterates over a collection of updateable objects, updating them with the amount of time that has passed since the last update
Generate a kitset game loop from zero build configuration
Simple game loop
A very accurate game loop, down to the nanosecond
An animation and game loop manager.
simple game loop for javascript – server or browser.
Simple game loop
A React-Redux game loop.
Component model, scene graph, game loop, and serialization for the Atmos Engine
A Rust crate that implements a frame-rate-independent game loop.
Tools for using SDL's main and callback APIs
AnimationDriver and Clock abstractions for the Animato animation library.
Game loop, the Game trait, Context and time for the game-toolkit game-jam kit.
Core ECS, Game Loop, and State Management for Jugar game engine
AnimationDriver and Clock abstractions for the Motus animation library.
Safe Rust bindings for raylib. sola-raylib N.x tracks raylib N.x (e.g. 5.x → raylib 5.5; 6.x → raylib 6.0).
ASCII/Codepage 437 terminal emulator with a game loop. Defaults to OpenGL, also support WebGPU (for Vulkan/Metal/WGPU), Curses and Crossterm for output. Part of the bracket-lib family.
LeMon - Monster Battle Library is a rust crate which contains game logic for simulated monster battles. The goals are to be easily extendable with new monsters, moves, abilities, etc. and to explore the structure of battle systems you would find in Pokemon or similar creature collectors.
A safe and ergonomic entry-point for playdate games using `playdate-sys`
A tool collection for building a winit game loop
Basis for a framerate-independent game loop. Only contains the calculations, so you could arrange the loop itself however you want.
Studio Game is a Ruby program developed based on Pragmatic Studio' Ruby Programming hands-on video course, and distributed as a Ruby gem. This program has been developed using all the strengths of Ruby including the following. Ruby Programming Environment * Installing Ruby on your favorite operating system (free exercise) * Running Ruby using the interactive Ruby shell (irb) and writing Ruby program files * Using Ruby's documentation system to get help * Installing external Ruby libraries using RubyGems * Troubleshooting common problems Ruby Language Constructs * Expressions and variables * Numbers, string, and symbols (free video & exercise) * Loops and conditional expressions * Arrays and hashes (free video & exercise on hashes) * Classes, modules, and structs Object-Oriented Programming * Using built-in Ruby classes * Defining your own classes with state and behavior (free video & exercise) * Creating unique objects * Telling objects what to do by calling methods * Modeling class-level inheritance relationships * Sharing code with mixins Object-Oriented Design Principles * Encapsulation * Separation of concerns * Polymorphism * Don't Repeat Yourself * Tell, Don't Ask Blocks and Iterators * Calling built-in methods that take blocks * Writing your own methods that yield to blocks * Implementing custom iterators * Effectively using blocks in your programs Organizing Ruby Code * Creating a Ruby project structure * Separating source files for easier reuse and testing * Namespacing to avoid naming clashes * Input/Output * Reading data from files * Writing data to files * Creating an interactive console prompt * Handling command-line input Unit Testing * Writing and running unit tests with RSpec * Test-driven development and the red-green-refactor cycle * Stubbing methods to control tests * Refactoring code, safely! Distribution * Conforming to RubyGems conventions * Writing a GemSpec * Building a RubyGem * Publishing a RubyGem to a public server Ruby Programming Idioms
# StudioGame (Alec) Jogo de terminal em Ruby com **jogadores, dados, tesouros e variações de jogadores** (Clumsy e Berserk), empacotado como gem. > Nome do gem (exemplo): `studio_game_alec` --- ## 🚀 Instalação e execução ### Rodando direto do código-fonte No diretório do projeto: ```bash ruby bin/studio_game ``` Se você não passar um arquivo de jogadores via CLI, o script usa o `players.csv` que fica em `bin/` por padrão. Também funciona passando um CSV na linha de comando: ```bash ruby bin/studio_game my_favorite_players.csv ``` ### Como gem (local) Empacote e instale localmente: ```bash gem build studio_game.gemspec gem install studio_game_alec-<versao>.gem ``` Depois rode: ```bash studio_game ``` > No Windows, o executável será resolvido pelo RubyGems. Se preferir, rode: `ruby bin/studio_game`. --- ## 📁 Estrutura do projeto ``` games/ ├─ bin/ │ ├─ studio_game # script principal (tem shebang) │ └─ players.csv # CSV padrão (nome,vida) ├─ lib/ │ └─ studio_game/ │ ├─ auditable.rb │ ├─ berserk_player.rb │ ├─ clumsy_player.rb │ ├─ die.rb │ ├─ game.rb │ ├─ game_turn.rb │ ├─ loaded_die.rb │ ├─ playable.rb │ ├─ player.rb │ └─ treasure_trove.rb ├─ spec/ │ └─ studio_game/ # specs RSpec ├─ LICENSE ├─ README.md └─ studio_game.gemspec ``` - **Namespace:** todo o código vive dentro do módulo `StudioGame` para evitar colisões. - **bin/studio_game:** script CLI com shebang (`#!/usr/bin/env ruby`). Faz _fallback_ do `$LOAD_PATH` para `lib` quando usado fora da gem. - **lib/studio_game/**: código da biblioteca (classes/módulos). - **spec/**: testes RSpec. --- ## 🧩 Conceitos principais - **Player** (`player.rb`): representa um jogador com `name`, `health`, coleta tesouros e calcula `score` (= `health` + `points`). Inclui o mixin **Playable**. - **Playable** (`playable.rb`): mixin com `w00t`, `blam` e `strong?` (altera/consulta `health` via getters/setters). - **TreasureTrove** (`treasure_trove.rb`): define `Treasure = Struct.new(:name,:points)` e a constante `TREASURES`; possui `.random`. - **Die/LoadedDie** (`die.rb`, `loaded_die.rb`): rolam valores (o carregado favorece 1,1,2,5,6,6). Ambos incluem **Auditable**. - **Auditable** (`auditable.rb`): imprime “Rolled a X (DieClass)” após cada rolagem. - **Game** (`game.rb`): agrega jogadores, carrega CSV, executa rodadas, soma pontos e salva _high scores_. - **GameTurn** (`game_turn.rb`): executa a lógica de um turno para um jogador (rola dado, aplica `blam/w00t/skip` e concede tesouro). - **ClumsyPlayer / BerserkPlayer**: variações de `Player` que modificam comportamento de `w00t` e de coleta de tesouros. --- ## 🧪 Testes Rode todos os testes: ```bash rspec ``` Principais coisas testadas: - Ordenação de jogadores por `score` (usa `<=>` em `Player`). - Cálculo de `points` e `score` (soma de tesouros + vida). - Efeitos de `w00t`/`blam` e força (`strong?`). - Lógica de turno com _stubs_ de dado (`allow_any_instance_of(LoadedDie).to receive(:roll).and_return(n)`). - Comportamentos de `ClumsyPlayer` e `BerserkPlayer`. --- ## 📦 CSVs e caminhos - `bin/studio_game` resolve o CSV padrão assim: ```ruby default_player_file = File.join(File.dirname(__FILE__), 'players.csv') game.load_players(ARGV.shift || default_player_file) ``` - Você pode passar um arquivo `.csv` via CLI como primeiro argumento. Formato do CSV: ``` Moe,100 Larry,60 Curly,125 ``` --- ## 🧾 High Scores Após sair do loop, o jogo grava `high_score.txt` com as entradas ordenadas. Cada linha é formatada por `Game#high_score_entry`: ``` <nome com padding de pontos> <score> ``` --- ## 🛠️ Dicas de desenvolvimento - Use `require 'studio_game/arquivo'` quando a gem estiver instalada. - No script binário, o `begin/rescue LoadError` faz _fallback_ para `$LOAD_PATH` local, útil fora da gem. - Para debugar I/O em testes, o spec redireciona `STDOUT` (`$stdout = StringIO.new`). --- ## 📚 Licença MIT – veja o arquivo `LICENSE`.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.