I am programming a bossfight in gamemaker, and I want my boss to shoot multiple fireballs simultaneously, but all in a bit of a different direction, a little bit like this, from rogue soul: rogue soul picture It (obviously) doesn't work, and I have been trying for over an hour. My script is:

//in the create event of fireball 1 
direction = hero + 10
speed = 12

//in the create event of fireball 2
direction = hero + 5
speed = 12

and so on.

It just refuses to work. The fireballs go a completely random direction, independent of where the hero is.

  • 1
    \$\begingroup\$ Have you been able to shoot one fireball in the direction of the hero? \$\endgroup\$ – Vaillancourt Jun 29 '19 at 20:50
  • \$\begingroup\$ It may be happening that from the position of the hero being received from various moments. Posting an image of what is going on in your game can help. Without first seeing it, I can recommend one more thing. Start with the first fireball with (hero - 10), second (hero - 5), third (hero), fourth (hero + 5) and fifth (hero +10). \$\endgroup\$ – Boneco Sinforoso Jun 29 '19 at 21:15
  • 1
    \$\begingroup\$ How do you compute your hero direction variable? \$\endgroup\$ – DMGregory Jun 30 '19 at 12:27
  • \$\begingroup\$ I figured it out myself. Thanks very much for the suggestions. And yes, next time I will put a picture of my game in the question :) \$\endgroup\$ – Chris V Schothorst Jul 1 '19 at 14:57
  • \$\begingroup\$ Consider posting an answer showing what you did to solve your problem. \$\endgroup\$ – Boneco Sinforoso Jul 2 '19 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.