Create a gist now

Instantly share code, notes, and snippets.

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 =, "a.jpg", true)
# simply grey to cover our first image
@grey =, "grey.jpg", true)
# small pointer or virtual coin to scratch-off the coating
@pointer =, "pointer.png", true)
@pos_x = 0
@pos_y = 0
def update
def draw
@background_image.draw(0, 0, 0)
@pointer.draw(mouse_x, mouse_y, 0)
a = mouse_x
b = mouse_y
circle a+5, b+5, 10, 10, :mode => :clear, :fill => true
@grey.draw(0, 0, 0)
window =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment