The slides of the talk I gave at DeccanRubyConf, 2014. It includes game history, concepts of game programming and about GOSU.
GOSU is a 2D game development framework. It works well for c++ and Ruby.
a http://andrewschultz.com/wp-content/uploads/2012/10/fun_heart_blue.jpghttps://www.flickr.com/photos/isriya/7180133440/in/photolist-bWu4w9-bWu2FL-bWu41J-bWu34N-bWu3BE-bWu3du-bWu2eu-bWu3PG-bWu4fC-bWu23w-6TqHos-5ZU29M-6m71g-6m7cG-6GPYhV-6m7nP-6m7g2-6m76Y-6m7aD-dnN9WN-6m7jB-6m749-dz56wz-dzaHgN-
GOSU • 2D Game Development Library. • Originally written in C++ by Julian Raschke and Jan Lucker. • Official Website: http://www.libgosu.org • Official game board: http://www.libgosu.org/cgi- bin/mwf/board_show.pl?bid=2
Move Eggs def update_next_egg_position(position)! ! #the egg has fallen, so increase fall count by 1! @fall_count += 1 ! ! #egg should move -400 to be visible at the screen! current_egg.x = current_egg.x - (400 * @fall_count)! ! end
Drop Egg ! ! def update_current_egg(egg)! egg.y = egg.y + @config['game']['gravity'] if egg.free_fall! ! #when pressed space, current egg should fall! if button_down?(Gosu::KbSpace)! egg.free_fall!! #to move the curret egg left only when it is not free fall! elsif button_down?(Gosu::KbLeft) && !egg.free_fall! egg.x = egg.x - 10 if egg.x > 100! elsif button_down?(Gosu::KbRight) && !egg.free_fall! egg.x = egg.x + 10 if egg.x < 700! end! end