Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
require 'gosu'
require 'texplay'
class GameWindow < Gosu::Window
def initialize
super 200, 200, false
self.caption = "Scratch-off Sample"
# below we set up the image resources that we'll use for the app
# your base image that will be hidden under the grey layer
@background_image = Gosu::Image.new(self, "a.jpg", true)
# simply grey to cover our first image
@grey = Gosu::Image.new(self, "grey.jpg", true)
# small pointer or virtual coin to scratch-off the coating
@pointer = Gosu::Image.new(self, "pointer.png", true)
@pos_x = 0
@pos_y = 0
end
def update
end
def draw
@background_image.draw(0, 0, 0)
@pointer.draw(mouse_x, mouse_y, 0)
a = mouse_x
b = mouse_y
@grey.paint{
circle a+5, b+5, 10, 10, :mode => :clear, :fill => true
}
#@background_image.draw(0,0,0)
@grey.draw(0, 0, 0)
end
end
window = GameWindow.new
window.show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.