Skip to content

Commit

Permalink
Simple examples
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Sep 15, 2011
0 parents commit c5871d2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
28 changes: 28 additions & 0 deletions gosu.rb
@@ -0,0 +1,28 @@
# Type in your code just below here:
require 'gosu'
class MyGame < Gosu::Window
def initialize
super(500, 500, false)
@count = 0
@position = 50
end
def update
@text = Gosu::Image.from_text(self,
"KidsRuby",
"Sans",
100)
@count = @count + 1
if @count > 300
@position = rand(100)
@count = 0
else
@position = @position + 1
end
end
def draw
@text.draw(@position, @position, 1)
end
end

window = MyGame.new
window.show
4 changes: 4 additions & 0 deletions simple.rb
@@ -0,0 +1,4 @@
# Type in your code just below here:
10.times do
puts "KidsRuby is AWESOME!"
end
11 changes: 11 additions & 0 deletions starburst.rb
@@ -0,0 +1,11 @@
# Type in your code just below here:
Turtle.draw do
background black
pencolor red
100.times do
distance = rand(100)
turnright rand(25)
forward distance
backward distance
end
end

0 comments on commit c5871d2

Please sign in to comment.