実験 800x450 公開中

スプライト実験

投稿者:ikosami 投稿日時: 2013/08/18 09:57:59
閲覧: 129 評価: 0
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
  • Starwhite
あなたはまだ評価していません。
game.loading do |loader| loader.add :window, :system => "window" loader.add :gui_item, :system => "gui_item" loader.add :ikosami_image, 158 end #変数関数 Variable = {} def setVariable(a, b) Variable[a] = b end def getVariable(a) Variable[a] end setVariable(:x, 400) # ゲームの初期化 game.on_init do set_window_image :window set_gui_image :gui_item # オープニングのシーンへ scene_change :start_scene end scene :start_scene do |scene| scene.on_init do sp = scene.add :image, :template => :ikosami, :center_position => [0, 0] sp2 = scene.add :image, :template => :ikosami, :center_position => [400, 0] speak("表示テスト") sp.event :on_click do |event| # モーション変更 x = rand(300) y = rand(200) sp.set_position x, y end sp2.event :on_click do |event| # モーション変更 setVariable(:x, getVariable(:x)+20) if getVariable(:x) > 650 setVariable(:x, 0) end sp2.set_position getVariable(:x),0 end end end sprite_template :ikosami do |st| st.texture :ikosami_image st.src_size 300, 300 st.dest_size 300, 300 st.center_offset 0, 0 #当たり判定 st.collision :rect, :position => [0, 0], :width => [300, 300] st.motion :default do |commands| commands.loop false commands.proc_call do |sprite| sprite.change_animation :anim end end st.animation :anim do |commands| commands.loop true commands.copy_rect :frame => 6, :src => [0, 0] commands.wait_animation commands.copy_rect :frame => 6, :src => [1, 0] commands.wait_animation commands.copy_rect :frame => 6, :src => [2, 0] commands.wait_animation commands.copy_rect :frame => 6, :src => [3, 0] commands.wait_animation commands.copy_rect :frame => 6, :src => [2, 0] commands.wait_animation commands.copy_rect :frame => 6, :src => [1, 0] commands.wait_animation end end
コード一覧
  • start.rb

コメントするには、ログインする必要があります。

コメント一覧
お知らせ

2014/03/04 ver. 0.1.39 を公開しました!
・0.1.36でWindowsで起動しない問題を修正しました
(Android版はバージョン番号のみの変更です。)

2014/03/04 ver. 0.1.36 を公開しました!
・アプリケーションアイコンを変更しました
・セーブ・ロードを繰り返すとアプリが強制終了する問題を修正しました
・他、重大なバグを修正しました

ダウンロードはこちらから。

2013/07/17 Code on Rmakeをα公開しました!