11. Rubyらしい記述 – モーション
st.motion :default do |commands|
commands.proc_call do |sprite|
sprite.change_animation :down
end
# 座標(384, 209)に4px/frameの速度で移動
commands.move_to_v 384, 209, 4
end
12. Rubyらしい記述 – イベント処理
scene :start_scene do |scene|
scene.on_init do
scene.add :image, :name => :human1,
:template => :human, :center_position => [450, 16]
# スプライト「 :human1 」タップすると文章を表示
scene.event :human1, :on_click do
speak "タップすると文章を表示します“
end
end
end