Hello and sorry about my english ;)
I want to make an space-shooter-game, where the player controls a ship and build weapons (turret-controlled) with power-ups (like in battlespace commander - a really great game!!!).
The turret-behavior is absolutly great to control the weapons and it works fine when i "shot" a bullet in direction of an enemy.
I also want to have a laser as weapon - and the width of the laser should be the same as the distance between the weapon (turret) and enemy (not a fixed-width-laser-sprite that shoots into the enemy like a bullet).
I hope you understand what i mean?
The problem is, that the width of the laser is always the distance between turret and enemy ONE (the first created one).
I created an test-capx to show you my problem:
CAPX or LIVE DEMO
(Arrow-keys to control)
The command for shooting:
Turrend: on shoot - Turrent spawn Laser, set width or Laser to distance (Turrent.X, Turrent.Y, Enemy.X, Enemy.Y)