Order of throwing in "deadly-discs"


#1

Hello,

I passed the level but I have a question about it.

How come when I throw the discs, it start by the last coordinate indicated ?

targets = []
targets.append({ "x": hero.pos.x-5, "y": hero.pos.y})
targets.append({ "x": hero.pos.x, "y": hero.pos.y + 5 })
targets.append({ "x": hero.pos.x, "y": hero.pos.y - 5 })

For instance, I had to write
targets.append({ "x": hero.pos.x, "y": hero.pos.y - 5 })
in order to throw the disc down at first.

Is it always like that ? Is there a logic underneath ?

level : https://codecombat.com/play/level/deadly-discs
character : Arryn

Thank you,
Eliot


#2

Are you using targets.pop() or targets.pop(0)?


#3

When I write

   target = targets.pop(0)

or

   target = targets.pop()

the throwing is in the same order. By the way, I am not sure to understand the difference between the two.

Do you need the full code ?


#4

Nope. There is a problem with Python interpreter. pop(0) doesn’t work correctly: it works like pop(). As the result that level instructions are little wrong. :frowning: