main_character.rb
def update
    if @moving then
      if (@move_x > 0) then
        @move_x -= 1
        @x += 1
      elsif @move_x < 0 then
        @move_x += 1
        @x -= 1
      elsif @move_x == 0 then
        @moving = false
      end

      if @move_y > 0 then
        @move_y -= 1
        @y += 1
      elsif @move_y < 0 then
        @move_y += 1
        @y -= 1
      elsif @move_y == 0 then
        @moving = false
      end
    end
  end
#initialize and set x and y properties
initialize and set x and y properties
initialize and set x and y properties
def update
    if @moving then
      if (@move_x > 0) then
        @move_x -= 1
        @x += 1
      elsif @move_x < 0 then
        @move_x += 1
        @x -= 1
      elsif @move_x == 0 then
        @moving = false
      end
      if @move_y > 0 then
        @move_y -= 1
        @y += 1
      elsif @move_y < 0 then
        @move_y += 1
        @y -= 1
      elsif @move_y == 0 then
        @moving = false
      end
    end
  end
def update if @moving then if ( @move_x > 0 ) then @move_x -= 1 @x += 1 elsif @move_x < 0 then @move_x += 1 @x -= 1 elsif @move_x == 0 then @moving = false end if @move_y > 0 then @move_y -= 1 @y += 1 elsif @move_y < 0 then @move_y += 1 @y -= 1 elsif @move_y == 0 then @moving = false end end end
initialize and set x and y properties
initialize and set x and y properties