im trying to store the events current location in an array shuffle the location of each event
here is what i have
$game_map.events.each_pair{|i,event|
@event[i] = [event.x,event.y]}
delay(5)
@events = $game_map.events.clone
@event.shift
@event.shuffle!
@event.unshift(nil)
$game_map.events.each_pair{|i,event| p i,@event[i]
event.moveto(@event[i][0],@event[i][1])}
class Array
def shuffle!
size.downto(1) { |n| push delete_at(rand(n)) }
self
end
end
Is what you are doing is just trying to randomly mix up the at what index each value has in the array? If so, I may have a different approach that you may find useful.
im trying to shuffle the locations im working on a jigsaw puzzle script so i need you to see the events in place then shuffle there locations then im comparing them by storing them with .clone before i shuffle them
When using the $game_map.events.each_pair in the end, don't you now move a copy of the event? I never work that far with arrays, so...