Fun With Ruby And Gosu Javier Ramirez

Post on 10-May-2015

4438 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Slides for javier ramirez's talk at EuRuKo 2009

Transcript

* in *

EuRuKo presents

Javier Ramírez(javier@formatinternet.com)

Fun with Ruby (and without r***s)

Program your own games with Gosu

the charactersRuby ................. as The Damsel Hardware ............ as The Villain Gosu ...................... as The Hero Chipmunk ........ as The Scientist Rubyscript2exe ........ as Himself

why gameswork rest play sleep

improve, have fun

why ruby

because i can! less code, less cluttereasy to try out

why meBASICLOGO

PASCAL / DBase

Assembler

C/C++SQL

VBasic

HTML ASP

JavaScript

JAVAPHP

RUBY

Non-technical considerations● concept ● game specs / core design● gameplay/game mechanics● balance● look and feel

More at “Game Architecture and Design: A New Edition”by Andrew Rollings & David Morris

what's in a game?(game development 101)

Part I

Web Development Abstraction

One ring to rule them all

Game Development Abstraction

3D games are the same, just harder

Game Development Components

the living game

Development Components● main loop / event loop● game logic: levels, collisions, AI ...● stateless images (tiles / models)● stateful images (sprites / models)● sound FX and music

when Ruby met Gosu

Part II

about by Julian Raschke and Jan Lücker

Gosu (고수 ): High Hand - Leader

C++ + Ruby Bindings

http://code.google.com/p/gosu/(http://tinyurl.com/euruko-gosu)

design rationaleBloatfree: Gosu aims to contain everything that is necessary to write a game in clean C++ or Ruby code, yet not much more.

Reality-driven: Everything in Gosu exists for the same single reason: It was necessary for an existing project. Nothing was, and will ever be, added out of boredom.

game demo

source code

http://code.google.com/p/eurukuest(http://tinyurl.com/eurukuest)

http://tinyurl.com/euruko-games

Gosu::Window

Gosu::Image

load individually or tiled

drawing can be rotated / scaled

supports z-index

can use Rmagick objects

Gosu::Sample & Gosu::Song

full playback controlvolume, speed, pause, resume, stop, pan

looping supported

midi are better if converted to XM

Gosu::Font

can be a system font or a file

easy to check the real width

supports rotation and scaling

code walkthrough

aboutby Scott Lembcke

A 2D rigid body physics library, designed with 2D video games in mind.

http://code.google.com/p/chipmunk-physics(http://tinyurl.com/euruko-chipmunk)

about

about

chipmunk basicsSpaceBodyShapeVectJoint

your 15 minutes of fame

Part III

doing it is just half the fun

tar2rubyscriptby Erik Veenstra

RBA file:init.rb => tar + base64 + comments

rubyscript2exeby Erik Veenstra

packages ruby, the script and alldependencies together into an executable file.

works on windows, linux, OSx

rubyscript2exeFirst Step: it runs the application, checking for all the required gems and scripts, creating a list of dependencies to include in the executable

rubyscript2exeThe “Environment Embedding Executable” gzips all the dependenciesand attaches the file to a copy of eee

http://formatinternet.comjavier@formatinternet.comhttp://twitter.com/supercoco9

muhahahahaha!

http://www.workingwithrails.com/person/5987-javier-ramirez

top related