My laser
basicProjectile->setAnchorPoint(Point::ANCHOR_MIDDLE_LEFT);
basicProjectile->setRotation(weaponBody->getRotation());
x_final = player->getPositionX() + winSize.width*0.275;
y_final = player->getPositionY() + winSize.height*0.275;
x_limit = Vec2(x_final, y_final);
basicProjectile->setPosition(newPoint);
scaleAmmo = basicProjectile->getContentSize().width / basicProjectile->getPosition().getDistance(x_limit);
basicProjectile->setScaleX(1.0f / scaleAmmo);
basicProjectile->setRotation(weaponBody->getRotation());
scaling = Sequence::create(
ScaleTo::create(0.1f, (1.0f / scaleAmmo), basicProjectile->getScaleY()*0.1),
nullptr);
scaling->setTag(1);
basicProjectile->runAction(scaling); //stretches the laser
on my physics collision
bodyA->getNode()->stopActionByTag(1); //stops the stretching of laser
laserEffects(bodyB->getNode(), bodyB->getNode()->getPosition()); // currently creates/spawns the effect at the anchor point of bodyB which is the tile shown at the picture.
Now I want to spawn it where the laser has stop stretching.
