Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'gosu'
- Width = 640
- Height = 480
- class Player
- def initialize(window)
- @window = window
- @w = 25
- @h = 100
- @x = 0
- @y = Height / 2 - @h / 2
- end
- def draw
- c = 0xFFFFFF
- @window.draw_quad(
- 0, 0, c,
- 0, 10, c,
- 10, 0, c,
- 10, 10, c
- #@x, @y, c,
- #@x, @y + @h, c,
- #@x + @w, @y, c,
- #@x + @w, @y + @h, c
- )
- end
- end
- class Window < Gosu::Window
- def initialize
- super(Width, Height, false)
- self.caption = "Pong"
- @player1 = Player.new(self)
- end
- def draw
- @player1.draw()
- end
- end
- Window.new.show
Add Comment
Please, Sign In to add comment