Hi @DaRkFoX, welcome to the forum. I’m not sure exactly why this is happening. Maybe C++ isn’t supposed to use object literals like that…
An easy solution is just to change this:
To: Vector(friend.pos.x - diffx, friend.pos.y - diffy)
It does exactly the same thing. You’ll use Vectors() more later, but I think this might be a good temporary fix for this.
I’m sorry I couldn’t give a more satisfactory answer, but I don’t actually know that much about C++. The above change did make it work for me though.
Hey there! As Xython and Deadpool mentioned above, please use the Vector(x,y) for this level. We haven’t fully implemented object literals for CPP, so some levels might need a different approach. (Usually you could use {x: xPos, y: yPos} for CPP, but something must’ve been broken). Sorry for the inconvenience!
@milton.jinich In case if you don’t know something for sure don’t post…
You do not need to pass Summit Gate or own any book to use Vectors and all the possibilities of the language. They are available from the first to the last level.
@Chaboi_3000 I’m really perplexed if {x: xPos, y: yPos} is available for coco cpp . This isn’t c++!
I think creating a position can be something like this:
but same code triggers an error in CoCo: