netlogo - How can I simulate a moving patch? -


i'm trying make frogger-like game patches move around , turtle can move onto safe patch. if have few patches red, how can 'move' them around if turtles? have this, seems move more 1 patch @ time , result, red patches destroyed if there more 1 red:

if pcolor = red [ ask patch-at 0 1   [ set pcolor red]   set pcolor black ] 

you ask neighbor patch (left or right) painted red , actual patch painted black or whatever default color is.

for you'll want actual patch coordinates. using patch-at asks patch @ 0,1 relative whole world.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -