Class: Itchy

Inherits:
Gosu::Window
  • Object
show all
Defined in:
lib/scrit.rb

Instance Method Summary collapse

Constructor Details

#initializeItchy

Returns a new instance of Itchy.


8
9
10
11
12
13
14
# File 'lib/scrit.rb', line 8

def initialize
    super 480, 360, false
    self.caption = "Scrit (Scratch in Ruby)"

    @stage = Stage.new(self)
    @sprites = []#[Cloud.new(self), Fish.new(self)]
end

Instance Method Details

#button_down(id) ⇒ Object


29
30
31
32
33
# File 'lib/scrit.rb', line 29

def button_down(id)
    if id == Gosu::KbEscape
        close
    end
end

#drawObject


24
25
26
27
# File 'lib/scrit.rb', line 24

def draw
    @stage.draw
    @sprites.each { |s| s.draw }
end

#green_flagObject


16
17
18
# File 'lib/scrit.rb', line 16

def green_flag
    show
end

#stageObject


35
36
37
# File 'lib/scrit.rb', line 35

def stage
    @stage
end

#updateObject


20
21
22
# File 'lib/scrit.rb', line 20

def update
    @sprites.each { |s| s.scripts }
end