I want to make a shmup in GM
I want to make a shmup in GM
So..... how do i make bullet-hell patterns? I mean in normal object editor you can only set 8 directions while i want to make bullets fly at different angles.... can anyone help me with that?
My concept of a shmup: Two weapons (Straight and spread).... power-ups and gems worth 500 points each O_o a bullet-hell shmup with simple system
My concept of a shmup: Two weapons (Straight and spread).... power-ups and gems worth 500 points each O_o a bullet-hell shmup with simple system
Zenodyne R - My 2nd Steam Shmup
-
Shatterhand
- Posts: 4099
- Joined: Wed Jan 26, 2005 3:01 am
- Location: Rio de Janeiro - Brazil
- Contact:
If you are using the drag 'n' drop interface, you need to use the blue arrow icon for movement (Sorry, I can't rememeber the proper name, as I never used the drag 'n' drop interface, I do all in GML code)
You can then insert any direction from 0 to 360, 0 being to right, 90 upwards, 180 left and 270 downwards.
Also, if you prefer, in the CREATE event of the BULLET object, you can insert a snipet of gml code like that:
SPEED = 5
DIRECTION = 270
This will make each instance of this bullet go downwards at the speed of 5 pixels per frame as soon as the bullet is "created". Changing the value of direction and speed will change the direction and speed of the bullet (If this wasn't obvious enough
)
try to play with those tips, and if you have more doubts you can ask it here
You can then insert any direction from 0 to 360, 0 being to right, 90 upwards, 180 left and 270 downwards.
Also, if you prefer, in the CREATE event of the BULLET object, you can insert a snipet of gml code like that:
SPEED = 5
DIRECTION = 270
This will make each instance of this bullet go downwards at the speed of 5 pixels per frame as soon as the bullet is "created". Changing the value of direction and speed will change the direction and speed of the bullet (If this wasn't obvious enough

try to play with those tips, and if you have more doubts you can ask it here

Last edited by Shatterhand on Fri Aug 24, 2007 5:05 pm, edited 1 time in total.

-
Shatterhand
- Posts: 4099
- Joined: Wed Jan 26, 2005 3:01 am
- Location: Rio de Janeiro - Brazil
- Contact:
Got it... thanks a lot, drawing bullets is not a problem for me, i'll learn how to draw ships too 
EDIT:

Hay guys it's my first decent sprite

EDIT:

Hay guys it's my first decent sprite
Zenodyne R - My 2nd Steam Shmup
Sorry for double-post but anyone knows but how to make delays between fired bullets by player ship? in drag&drop method
Zenodyne R - My 2nd Steam Shmup
-
angrycoder
- Posts: 232
- Joined: Mon Jan 31, 2005 1:34 pm
- Location: Pennsylvania, USA
-
Shatterhand
- Posts: 4099
- Joined: Wed Jan 26, 2005 3:01 am
- Location: Rio de Janeiro - Brazil
- Contact:
-
battlegorge
- Posts: 67
- Joined: Thu Feb 16, 2006 12:39 pm
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
In drag&drop it's easiest to use alarms to make delays.
ie. all shooting code will be in alarm0 action and after shot you'll set alarm0 to, say, 20. After 20 frames the action will then repeat itself. You'll also have to start alarm0 when object is created or when it comes into view.
ie. all shooting code will be in alarm0 action and after shot you'll set alarm0 to, say, 20. After 20 frames the action will then repeat itself. You'll also have to start alarm0 when object is created or when it comes into view.
"A game isn't bad because you resent it. A game is bad because it's shitty."
Bump, asking a question... it's possible to code complex patterns in GML? Like 3-way spread fire at you or rotating shots ala psikyo games? because i would like to begin shmup once again... so it's about putting a piece of code in drag&drop interface?
Zenodyne R - My 2nd Steam Shmup
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
It's possible to do it without using pieces of code but it's a lot of unnecessary work. GML is easiest language ever made.Kaiser wrote:Bump, asking a question... it's possible to code complex patterns in GML? Like 3-way spread fire at you or rotating shots ala psikyo games? because i would like to begin shmup once again... so it's about putting a piece of code in drag&drop interface?
3-way spread is incredibly easy to make in GML. Just use following piece of code.
Code: Select all
bul1=instance_create(x,y,bullet)
bul2=instance_create(x,y,bullet)
bul3=instance_create(x,y,bullet)
bul1.direction=point_direction(x,y,player.x,player.y)
bul2.direction=point_direction(x,y,player.x,player.y)-20
bul3.direction=point_direction(x,y,player.x,player.y)+20
bul1.speed=4
bul2.speed=4
bul3.speed=4
for rotating objects you can use following:
Code: Select all
image_angle=image_angle+rotationspeed
"A game isn't bad because you resent it. A game is bad because it's shitty."
Thanks a lot worstplayer, i must learn how to code fire button and it's powerups, basically it will be about variables, and other code will be executed (I mean bigger spread weapon) depending on how much powerups has been collected
of course, it is possible

Zenodyne R - My 2nd Steam Shmup
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
Well, unless you want to shoot every frame, coding shots is pretty complicated stuff and there are many different ways to do it. Here's my method (probably not the best, but it works).
first you need some kind of timer. So set up some variable when object is created (ie. in create event) And in step event you have something like this
as for powerups, i just make separate action for each power level.etc.
Again, i'm sure there are better ways to do it. Maybe someone better than me could post some examples.
first you need some kind of timer. So set up some variable when object is created (ie. in create event)
Code: Select all
delay=0
Code: Select all
if delay<1 and keyboard_check(ord("Z")){
delay= ---how many frames to wait before next shot---
---your shooting code---
}
delay-=1
Code: Select all
if power=1{
---your level 1 shot---
}
if power=2{
---your level 2 shot---
}
Again, i'm sure there are better ways to do it. Maybe someone better than me could post some examples.
"A game isn't bad because you resent it. A game is bad because it's shitty."
-
- Posts: 9
- Joined: Fri Oct 28, 2005 7:07 am
- Contact:
It's better to do this with a switch statement.worstplayer wrote:
as for powerups, i just make separate action for each power level.Code: Select all
if power=1{ ---your level 1 shot--- } if power=2{ ---your level 2 shot--- }
I.e:
Code: Select all
switch (power) {
case 1:
//Level 1 Shot
break;
case 2:
//Level 2 Shot
break;
case 3:
//Level 3 Shot
break;
default:
//Actions if a case isn't met
}
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
Hmmm, i didn't even know such thing existed in GML. Looks useful. Thanks.Shion wrote: It's better to do this with a switch statement.
I.e:Code: Select all
switch (power) { case 1: //Level 1 Shot break; case 2: //Level 2 Shot break; case 3: //Level 3 Shot break; default: //Actions if a case isn't met }
"A game isn't bad because you resent it. A game is bad because it's shitty."