Skip to content

Instantly share code, notes, and snippets.

@vivit-jc
Created June 15, 2017 08:18
Show Gist options
  • Save vivit-jc/6ea8a70db6bd8aaf3ce90b8374cd16bd to your computer and use it in GitHub Desktop.
Save vivit-jc/6ea8a70db6bd8aaf3ce90b8374cd16bd to your computer and use it in GitHub Desktop.
DXRubyサンプル
map_images = [
Image.load( "aa.png" ),
Image.load( "bb.png" ),
Image.load( "cc.png" )
]
map = [
[0,0,0,0,0],
[0,0,0,0,0],
[0,0,0,2,0],
[0,0,2,2,2],
[1,1,1,1,1]
]
sprites = []
5.times do |i|
5.times do |j|
sprites << Sprite.new(j*20, i*20, map_images[map[i][j]])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment