Let's start with the look_around action. In level Greenfields this action gives back a view with radius 1. In level Clone War you can now pass the radius as parameter. The view with radius 2 is shown on right.
As it is a circular view, the corners are missing. For those fields you will get back nil instead of a field.
The action costs are dependent of the view radius. A view with radius 2 will cost 5 action points. The one with radius 1 still costs 2 action points and with radius 0 you will get back your own position for 0.2 action points.
new_population = old_population.split(field) population.look_around(0) # equal to look_at(0,0) population.look_around # radius 1 population.look_around(2) # radius 2
You can also get a single field with look_at and pass the field you want to see as parameter. But you have to make sure this field is within radius 1.
new_population = old_population.split(field) population.look_at(1,0) population.look_at(field)
Also the move_to action has some small changes. The action costs for vertical and horizontal direction remain 6 action points, while moving diagonally now costs 8.5 AP.
For more information see the documentation.

Keine Kommentare:
Kommentar veröffentlichen