movedX

概要

p5.jsリファレンス(参考情報)

[p5.js] movedX

サンプル

def setup
  @x = 50
  rectMode(CENTER)
end

def draw
  if @x > 48
     @x -= 2
   elsif @x < 48
     @x += 2
   end
   @x += (movedX / 1).floor
   background(237, 34, 93)
   fill(0)
   rect(@x, 50, 50, 50)
end

構文

戻値