Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- note
- description: "Adding ghosts to Zurich."
- class
- GHOST_INVASION
- inherit
- ZURICH_OBJECTS
- feature -- Explore Zurich
- invade
- -- Add ghosts to random stations.
- local
- random: V_RANDOM
- radius: REAL_64
- i, cpos: INTEGER
- station: STATION
- do
- create random
- from
- i := 1
- until
- i > 10
- loop
- radius := random.bounded_item (10, 100).to_double
- random.forth
- cpos := random.bounded_item (1, Zurich.stations.count)
- random.forth
- across
- zurich.stations as c
- loop
- c.go_to (cpos)
- station := c.item
- c.finish
- end
- add_ghost (station, radius)
- i := i + 1
- end
- end
- add_ghost (a_station: STATION; a_radius: REAL_64)
- -- Add a ghost going around `a_station'.
- require
- a_station_exists: a_station /= Void
- a_radius_positive: a_radius > 0.0
- local
- ghost: GHOST
- do
- create ghost.make (a_station, a_radius)
- Zurich.add_custom_mobile (ghost)
- Zurich_map.update_mobile
- Zurich_map.update
- Zurich_map.custom_mobile_view (ghost).set_icon ("..\image\ghost.png")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement