Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
Created May 3, 2017 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ongaeshi/aac342db92ce362d1eb69351d31fe819 to your computer and use it in GitHub Desktop.
Save ongaeshi/aac342db92ce362d1eb69351d31fe819 to your computer and use it in GitHub Desktop.
Moving Circle
# 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