Zitat Zitat von Adrian2000 Beitrag anzeigen
kannst du statt den spoieler-cod den PHP-code benutzen?
daher jetzt die Leerzeichen weg sind.
also solltest dann zB so aussehen:
PHP-Code:
class Game_Character
  def move_to_event
(event_id)
    
# Get difference in event coordinates
    
sx = @$game_map.events[event_id].x
    sy 
= @$game_map.events[event_id].y
    
# If coordinates are equal
    
if sx == and sy == 0
      
return
    
end
    
# Get absolute value of difference
    
abs_sx sx.abs
    abs_sy 
sy.abs
    
# If horizontal and vertical distances are equal
    
if abs_sx == abs_sy
      
# Increase one of them randomly by 1
      
rand(2) == abs_sx += abs_sy += 1
    end
    
# If horizontal distance is longer
    
if abs_sx abs_sy
      
# Move towards event, prioritize left and right directions
      
sx move_left move_right
      
if not moving? and sy != 0
        sy 
move_up move_down
      end
    
# If vertical distance is longer
    
else
      
# Move towards event, prioritize up and down directions
      
sy move_up move_down
      
if not moving? and sx != 0
        sx 
move_left move_right
      end
    end
  end
end