Graphics provides a simple framework to implement games and/or simulations and is designed to follow mathematical conventions, NOT game programming conventions. Particularly it:
These allow simple things like Trigonometry functions to work as expected. It means that all that stuff you were taught it grade school still work as intended. This makes one less thing you have to adjust when implementing your simulation.
class Ball < Graphics::Body def initialize w super # ... end def draw w.angle x, y, a, 10+3*m, :red w.circle x, y, 5, :white, :filled end def update fall move bounce end # ... end class BounceSimulation < Graphics::Simulation attr_accessor :bs def initialize super 640, 640, 16, "Bounce" self.bs = populate Ball end def update n bs.each(&:update) end def draw n clear bs.each(&:draw) fps n end # ... end BounceSimulation.new.run
See examples/*.rb for more
gem install graphicsIf you want to hack on graphics, clone it from GitHub:
git clone git://github.com/seattlerb/graphics