57%(7)4 out of 7 people found this document helpful
This preview shows page 1 - 3 out of 3 pages.
require 'gosu'module ZOrderBACKGROUND, MIDDLE, TOP = *0..2endWIDTH = 400HEIGHT = 500SHAPE_DIM = 50# Instructions:# Fix the following code so that:# 1. The shape also can be moved up and down# 2. the shape does not move out of the window areaclass GameWindow < Gosu::Window# initialize creates a window with a width an a height# and a caption. It also sets up any variables to be used.# This is procedure i.e the return value is 'undefined'def initializesuper WIDTH, HEIGHT, falseself.caption = "Shape Moving"@shape_y = HEIGHT / 2
@shape_x = WIDTH / 2end# Put any work you want done in update# This is a procedure i.e the return value is 'undefined'