Created
May 3, 2017 08:37
-
-
Save ongaeshi/aac342db92ce362d1eb69351d31fe819 to your computer and use it in GitHub Desktop.
Moving Circle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
a = 1 | |
b = 3 | |
array = [1, 2, 3] | |
# array.each { |e| } | |
r = a + b + array[0] + array[1] + array[2] | |
println "Hello mruby #{r}" | |
println "こんにちは, Siv3DRuby" | |
# wait_key | |
x = -100 | |
y = 480 | |
while System.update do | |
Circle.new(Point.new(x, y), 50).draw | |
if x > 800 | |
x = -100 | |
y = 480 | |
end | |
x += 1 | |
if x > 320 - 50 | |
y += 1 | |
else | |
y -= 1 | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment