fun with ruby and gosu javier ramirez

34
* in * EuRuKo presents Javier Ramírez ([email protected]) Fun with Ruby (and without r***s) Program your own games with Gosu

Upload: javier-ramirez

Post on 10-May-2015

4.438 views

Category:

Technology


0 download

DESCRIPTION

Slides for javier ramirez's talk at EuRuKo 2009

TRANSCRIPT

Page 1: Fun With Ruby And Gosu Javier Ramirez

* in *

EuRuKo presents

Javier Ramírez([email protected])

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

Program your own games with Gosu

Page 2: Fun With Ruby And Gosu Javier Ramirez

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

Page 3: Fun With Ruby And Gosu Javier Ramirez

why gameswork rest play sleep

improve, have fun

Page 4: Fun With Ruby And Gosu Javier Ramirez

why ruby

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

Page 5: Fun With Ruby And Gosu Javier Ramirez

why meBASICLOGO

PASCAL / DBase

Assembler

C/C++SQL

VBasic

HTML ASP

JavaScript

JAVAPHP

RUBY

Page 6: Fun With Ruby And Gosu Javier Ramirez

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

Page 7: Fun With Ruby And Gosu Javier Ramirez

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

Part I

Page 8: Fun With Ruby And Gosu Javier Ramirez

Web Development Abstraction

Page 9: Fun With Ruby And Gosu Javier Ramirez

One ring to rule them all

Page 10: Fun With Ruby And Gosu Javier Ramirez

Game Development Abstraction

3D games are the same, just harder

Page 11: Fun With Ruby And Gosu Javier Ramirez

Game Development Components

Page 12: Fun With Ruby And Gosu Javier Ramirez

the living game

Page 13: Fun With Ruby And Gosu Javier Ramirez

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

Page 14: Fun With Ruby And Gosu Javier Ramirez

when Ruby met Gosu

Part II

Page 15: Fun With Ruby And Gosu Javier Ramirez

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)

Page 16: Fun With Ruby And Gosu Javier Ramirez

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.

Page 17: Fun With Ruby And Gosu Javier Ramirez

game demo

Page 18: Fun With Ruby And Gosu Javier Ramirez

source code

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

http://tinyurl.com/euruko-games

Page 19: Fun With Ruby And Gosu Javier Ramirez

Gosu::Window

Page 20: Fun With Ruby And Gosu Javier Ramirez

Gosu::Image

load individually or tiled

drawing can be rotated / scaled

supports z-index

can use Rmagick objects

Page 21: Fun With Ruby And Gosu Javier Ramirez

Gosu::Sample & Gosu::Song

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

looping supported

midi are better if converted to XM

Page 22: Fun With Ruby And Gosu Javier Ramirez

Gosu::Font

can be a system font or a file

easy to check the real width

supports rotation and scaling

Page 23: Fun With Ruby And Gosu Javier Ramirez

code walkthrough

Page 24: Fun With Ruby And Gosu Javier Ramirez

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)

Page 25: Fun With Ruby And Gosu Javier Ramirez

about

Page 26: Fun With Ruby And Gosu Javier Ramirez

about

Page 27: Fun With Ruby And Gosu Javier Ramirez

chipmunk basicsSpaceBodyShapeVectJoint

Page 28: Fun With Ruby And Gosu Javier Ramirez

your 15 minutes of fame

Part III

Page 29: Fun With Ruby And Gosu Javier Ramirez

doing it is just half the fun

Page 30: Fun With Ruby And Gosu Javier Ramirez

tar2rubyscriptby Erik Veenstra

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

Page 31: Fun With Ruby And Gosu Javier Ramirez

rubyscript2exeby Erik Veenstra

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

works on windows, linux, OSx

Page 32: Fun With Ruby And Gosu Javier Ramirez

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

Page 33: Fun With Ruby And Gosu Javier Ramirez

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

Page 34: Fun With Ruby And Gosu Javier Ramirez

http://[email protected]://twitter.com/supercoco9

muhahahahaha!

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