I want to make a shmup in GM

A place for people with an interest in developing new shmups.
Post Reply
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

I want to make a shmup in GM

Post by Kaiser »

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
Zenodyne R - My 2nd Steam Shmup
User avatar
Shatterhand
Posts: 4099
Joined: Wed Jan 26, 2005 3:01 am
Location: Rio de Janeiro - Brazil
Contact:

Post by Shatterhand »

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 :D)

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.
Image
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

Post by Kaiser »

Wait... Angle starts from Left or right?
Zenodyne R - My 2nd Steam Shmup
User avatar
Shatterhand
Posts: 4099
Joined: Wed Jan 26, 2005 3:01 am
Location: Rio de Janeiro - Brazil
Contact:

Post by Shatterhand »

right, if I am not mistaken, and it goes counter-clockwise.
Image
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

Post by Kaiser »

Got it... thanks a lot, drawing bullets is not a problem for me, i'll learn how to draw ships too :D

EDIT:
Image
Hay guys it's my first decent sprite
Zenodyne R - My 2nd Steam Shmup
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

Post by Kaiser »

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
User avatar
angrycoder
Posts: 232
Joined: Mon Jan 31, 2005 1:34 pm
Location: Pennsylvania, USA

Post by angrycoder »

make a variable called allowedToShoot or something, set it to false when a bullet is fired. Set a timer to turn allowedToShoot to true after x number of ticks. Only shoot when allowedToShoot is true.
User avatar
Shatterhand
Posts: 4099
Joined: Wed Jan 26, 2005 3:01 am
Location: Rio de Janeiro - Brazil
Contact:

Post by Shatterhand »

Kaiser, it may be a good idea to learn GML code at some point You will see it gives you more freedom and it's actually easier to do if you want to do some more complex stuff.

Every icon in the drag & drop interface has an easy command in GML.
Image
User avatar
battlegorge
Posts: 67
Joined: Thu Feb 16, 2006 12:39 pm

Post by battlegorge »

I would give the player a Timer.
You can shoot only if timer=0 !

After the shot you raise the timer (timer=20).
Decrease the timer in the step event:
if timer>0 timer-=1
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Post by worstplayer »

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.
"A game isn't bad because you resent it. A game is bad because it's shitty."
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

Post by Kaiser »

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
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Post by worstplayer »

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?
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.

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
Replace "bullet" and "player" with names of your bullet and player objects and change speed to suit your needs. You can also replace point_direction with fixed value for spreads not aimed at player.

for rotating objects you can use following:

Code: Select all

image_angle=image_angle+rotationspeed
replace "rotationspeed" with speed you want your object to rotate. (only works in registered GM). I think there isn't any d&d icon for things like this.
"A game isn't bad because you resent it. A game is bad because it's shitty."
User avatar
Kaiser
Posts: 1729
Joined: Mon Jun 12, 2006 10:20 am

Post by Kaiser »

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 :D of course, it is possible
Zenodyne R - My 2nd Steam Shmup
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Post by worstplayer »

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)

Code: Select all

delay=0
And in step event you have something like this

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
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---
}
etc.

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."
collapsicon
Posts: 9
Joined: Fri Oct 28, 2005 7:07 am
Contact:

Post by collapsicon »

the way I learned was by doing the shooter tut from the GM web site
and by pulling apart the example files, it shows you how to set bullet time and power ups, if you want I can send you the gm files for a shmup I made though its hor scrolling. I did every thing with objects since im not a coder
User avatar
Shion
Posts: 228
Joined: Wed Sep 05, 2007 8:28 pm
Location: Netherlands

Post by Shion »

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---
}
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
}
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Post by worstplayer »

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
}
Hmmm, i didn't even know such thing existed in GML. Looks useful. Thanks.
"A game isn't bad because you resent it. A game is bad because it's shitty."
Post Reply