Bug in a codecombat ladder game (help!)

link to game with bug
Hello everyone, I know this game isn’t played a lot (or maybe not at all anymore), so if you want to see what it is you can click on the link.
There is a bug in the game, and this is what it is.
When you are playing as team red, you can use code like this:

enemies = hero.findEnemies()
for enemy in enemies:
    if enemy and enemy.type == "archer":
        hero.cast("fireball", enemy.pos.x, enemy.pos.y)

and it works just fine. However, this type of code doesn’t work when you are team blue. Instead, it casts a fireball at the inverse x, inverse y of the enemy’s actual position… I think? It’s confusing, and all I know is that it works but casts a fireball at the wrong place.

If no one is able to fix this, then could someone help me figure out a way to cast a fireball at the correct position? e.g.

hero.cast("fireball", enemy.pos.x / 2 + 10, enemy.pos.y / 2 - 10)

Any help would be appreciated :slight_smile:

1 Like

dont use pos. in the ai leagues, its smthn.x not smthn.pos.x
this is used for mirrioring

tried using .x and .y, didn’t work

should I just use enemy.pos instead? never mind just tried it, same error

I still need help with this
anyone wanna help?

HELP! (200000 helps)

can you please send a screenshot of where the fireball casts and where the enemy is, a bunch of examples would be better :]

it might help in finding the way to get the right positions

1 Like

when I try to summon lightning on Hello243’s haunted tower, it summons on the other side


code:

def attackTower():
    enemies = hero.findEnemies()
    for enemy in enemies:
        if enemy and enemy.type == "haunted-tower":
            hero.cast('lightning', enemy.pos.x, enemy.pos.y)

Quite sure it’s because of coordinate mirroring, maybe try using it without pos?

tried not using .pos, see above picture (2nd comment on the post)