dcoder2099 / starfighter-gosu-tutorial Goto Github PK
View Code? Open in Web Editor NEWThis project forked from masonhale/starfighter-gosu-tutorial
Another Ruby Gosu Game Library Tutorial
License: MIT License
This project forked from masonhale/starfighter-gosu-tutorial
Another Ruby Gosu Game Library Tutorial
License: MIT License
This is another ruby tutorial for the awesome Gosu game library. (http://www.libgosu.org) This tutorial builds on the Ruby Tutorial example that is included in the game library. As a project to help teach my teenage son Ruby programming, we dissected the original Gosu Ruby Tutorial and put it back to together in steps to learn the basics of game programming and to make a game of our own. This tutorial borrows heavily from the media assets of the Gosu examples. Running ======= First, you need to install the gosu gem: $ gem install gosu Run the Main.rb file to see the final game: $ ruby Main.rb Background ========== The original Ruby Tutorial featured Asteroids-style navigation where left and right arrow keys rotate the ship, and the up and down keys control thrust and brake. The objective of the tutorial was to fly around the screen collecting stars. This tutorial features "Galaga-style" fixed-angle navigation, where left and right move the ship along the x-axis and up and down move the ship along the y-axis. More importantly we added weapons! The weapons include single-shot (Space Key) and double-shot (Option/Alt Key) lasers, a "super shot" cannon (Control Key) that fires slowly but destroys anything in its path, and finally a nuke (N Key) that clears all obstacles from the screen when detonated. The nuke is only available if the ship's power level is full. While in the original tutorial flying over a star would "collect" the star, in this tutorial hitting a star with your ship destroys the ship with an appropriately gratuitous explosion. To protect your ship you have a shield (Shift Key) that can be activated provided the ship's energy tank is not empty. Pressing 'P' will pause the game and display the various controls. There are cheat codes available on the pause screen, but you will have to look through the source code to discover what those are. This tutorial is broken into 6 steps: 01_basic_window.rb -- demonstrates Gosu::Window and its update/draw loop 02_graphics.rb -- demonstrates loading images and drawing to the window 03_basic_control.rb -- demonstrates input with a Ship that can fly around the screen 04_sounds_and_weaponry.rb -- adds weapons and sounds to 03_basic_control 05_collisions.rb -- add Stars as obstacles with simple collision detection Main.rb -- complete game with user interface, life counting, pause, etc. Classes are organized into separate files in lib directory
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.