I Wanna Be The Forums!

Please login or register.

Login with username, password and session length
Advanced search  

News:

Chat button has been eaten. Click here to join in the idling fun!

Author Topic: Bosses 101 (Need help)  (Read 2534 times)

RedsToad

  • Newbie
  • *
  • Posts: 5
    • View Profile
Bosses 101 (Need help)
« on: February 14, 2016, 04:29:19 am »

I'm pretty new to GMStudio. I need to know how to make bosses. I can figure out how to do animation, movement of the boss, but how do make bullets appear, fly in the random direction, at the player, in certain spot? Do I have to have a timer on boss, which counts the frames from the start of the attack so I can tell when the other attack should start? Do I need to code each bullet independently? How do I stop the boss from trying to kill the player when he is already dead?
EDIT: Also how can I stop certain bullets and then resuming them? (I hope that makes sense)
« Last Edit: February 15, 2016, 08:21:03 am by RedsToad »
Logged

SpaceH3R0

  • Full Member
  • ***
  • Posts: 159
  • It's happening
    • View Profile
Re: Bosses 101 (Need help)
« Reply #1 on: February 14, 2016, 06:24:58 am »

Use a timeline
Logged
*Shitty signature*

RedsToad

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Bosses 101 (Need help)
« Reply #2 on: February 14, 2016, 07:52:59 am »

Use a timeline
Thanks, but still a lot of questions unanswered
Logged

infern0man1

  • Unrevoked
  • Hero Member
  • *****
  • Posts: 611
  • It's been revoked.
    • View Profile
    • YouTube
Re: Bosses 101 (Need help)
« Reply #3 on: February 14, 2016, 10:46:09 am »

To make bullets appear, set up some spawner or make an alarm in the boss itself; to make bullets fly at the player, put:

Code: [Select]
a=instance_create(boss.x,boss.y,bullet1);
a.speed=[speed];
a.direction=point_direction(a.xstart,a.ystart,player.x,player.y);

For making bullets fly in random directions, replace the point_directiok with random(360) or something of the sort.

Depending on what you want the bullet do, you may or may not need to code it separately
« Last Edit: February 14, 2016, 10:47:43 am by infern0man1 »
Logged

RedsToad

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Bosses 101 (Need help)
« Reply #4 on: February 14, 2016, 01:00:21 pm »

To make bullets appear, set up some spawner or make an alarm in the boss itself; to make bullets fly at the player, put:

Code: [Select]
a=instance_create(boss.x,boss.y,bullet1);
a.speed=[speed];
a.direction=point_direction(a.xstart,a.ystart,player.x,player.y);

For making bullets fly in random directions, replace the point_directiok with random(360) or something of the sort.

Depending on what you want the bullet do, you may or may not need to code it separately

Thanks a lot! Gonna get working!
Logged

telemorph

  • Full Member
  • ***
  • Posts: 171
    • View Profile
Re: Bosses 101 (Need help)
« Reply #5 on: February 14, 2016, 04:18:42 pm »

Logged

RedsToad

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Bosses 101 (Need help)
« Reply #6 on: February 16, 2016, 02:03:13 am »

To make bullets appear, set up some spawner or make an alarm in the boss itself; to make bullets fly at the player, put:

Code: [Select]
a=instance_create(boss.x,boss.y,bullet1);
a.speed=[speed];
a.direction=point_direction(a.xstart,a.ystart,player.x,player.y);

For making bullets fly in random directions, replace the point_directiok with random(360) or something of the sort.

Depending on what you want the bullet do, you may or may not need to code it separately

Thanks again, but I have a slight problem. If the bullet kills the player than the next one will crash the game
P.S. I'm using instance_destroy to kill the player. Maybe there is another way to kill the player
Logged

infern0man1

  • Unrevoked
  • Hero Member
  • *****
  • Posts: 611
  • It's been revoked.
    • View Profile
    • YouTube
Re: Bosses 101 (Need help)
« Reply #7 on: February 16, 2016, 08:42:29 am »

set any bullet object to have playerKiller as its parent

Katz

  • Hero Member
  • *****
  • Posts: 519
    • View Profile
Re: Bosses 101 (Need help)
« Reply #8 on: March 09, 2016, 11:30:25 am »

EDIT: Also how can I stop certain bullets and then resuming them? (I hope that makes sense)

Sorry this wasn't answered,

Essentially, you set the speed variable to  = 0 (or whatever you set speed as in its moving function). Furthermore, alarms can be used to trigger any amount of seconds you want it to wait until you can set the speed back to = #.

Hope this helped, is the most mediocre way.
Logged
Join the official IWBTF discord server! https://discord.me/iwbtg

RedsToad

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Bosses 101 (Need help)
« Reply #9 on: March 09, 2016, 02:47:56 pm »

Wow, that's so basic! I should be ashamed I haven't figured it out
Logged