• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

help with beam guns

E

Emerald

Guest
hello I'm making a heavy lore based bullet h*** type game I really admired the beam guns from enter the gungeon such as the proton pack and was wondering if there was a way to make these types of guns (without making bullets extremely fast(that will mess up the turning)) if so could you please let me know how
 
B

BeastyBoy

Guest
ok maybe I'm just a complete idiot but I used it in a couple different places and I either get an (non fatal error) or doesn't fire from gun/stays in the same line am I missing something
well, this is a little hard to do, so I don't blame you.

I would do something like making the bullet do the with statement every step, checking for a collision every position along the direction pointing to the mouse, and when it hits somthing, it sets a variable for draw length for the beam.

If this is too confusing, i'll draw you a picture xD
 
E

Emerald

Guest
ok I thought I had it but I'm confused could you draw that picture
 
E

Emerald

Guest
well, this is a little hard to do, so I don't blame you.

I would do something like making the bullet do the with statement every step, checking for a collision every position along the direction pointing to the mouse, and when it hits somthing, it sets a variable for draw length for the beam.

If this is too confusing, i'll draw you a picture xD

ok yea I am really confused now could you draw it
 
Z

zircher

Guest
I'm worried that beastyboy might be messing with you. It will take a little bit more than just a with statement. For something like a proton pack beam, you're going to have to spawn a chain of sprites and have them loosely linked to each other so that it will whip about. The way to solve that problem is to break it down into smaller and smaller bits until it is a bunch of easier problems. Start with a gun and get it to shoot. Turn it into a flame thrower. Now make the flames connect to each other and extend the chain.
 
B

BeastyBoy

Guest
If not position_meeting(current_x,current_y,obj_solid) {
current_x+=bullet_hsp
current_y+=bullet_vsp
}
 
E

Emerald

Guest
I'm worried that beastyboy might be messing with you. It will take a little bit more than just a with statement. For something like a proton pack beam, you're going to have to spawn a chain of sprites and have them loosely linked to each other so that it will whip about. The way to solve that problem is to break it down into smaller and smaller bits until it is a bunch of easier problems. Start with a gun and get it to shoot. Turn it into a flame thrower. Now make the flames connect to each other and extend the chain.

uhhhhh how do I do that never really made a flame thrower and that linking thing never worked with any type of gun variables other than the basic array
 
B

BeastyBoy

Guest
woudnt that just prevent it from moving
You know what? I just realized I gave you "With" and not "While".

im sorry, "While" statements are "If" but on steroids.

I used a while statement in my game to make sure a flashlight doesnt pass through a wall, and I had a hard time. I hate to tell you, but i'm afraid I just cannot help you any farther. :(
 
E

Emerald

Guest
You know what? I just realized I gave you "With" and not "While".

im sorry, "While" statements are "If" but on steroids.

I used a while statement in my game to make sure a flashlight doesnt pass through a wall, and I had a hard time. I hate to tell you, but i'm afraid I just cannot help you any farther. :(

ok
 
Z

zircher

Guest
For most most video games, a flame thrower is like a gun but spawns short lived sprites instead of bullets. Not that hard of a step up. Your proton pack beam (as far as I can tell from video clips of the game) is just a string of sprites that have behavior based on their neighbor and what they collide with. Again, not that hard if you work up to it. It just something that you have to work up to in steps.
 
E

Emerald

Guest
For most most video games, a flame thrower is like a gun but spawns short lived sprites instead of bullets. Not that hard of a step up. Your proton pack beam (as far as I can tell from video clips of the game) is just a string of sprites that have behavior based on their neighbor and what they collide with. Again, not that hard if you work up to it. It just something that you have to work up to in steps.

woud i do that joint_pulley
 

Khao

Member
One of my favorite ways of doing beams and lasers is by using a single-pixel-wide sprite.

Like this:



Then when you create the beam object, all you have to do is change image_xscale to the desired length of the beam, so it looks like this:



Then you just control its direction with image_angle. It's that simple!

The only downside is that there's certain kind of animations you can't do. But there's still plenty of ways to make it look interesting.
 
Z

zircher

Guest
woud i do that joint_pulley
That might be over-kill if you're not using the physics system. If you simply had a list of sprites and each one checked their position against the neighbor, that might work

Khoa's idea has merit too even though it is aimed (ha ha) at straight lines and not arcs of plasma.
 
E

Emerald

Guest
That might be over-kill if you're not using the physics system. If you simply had a list of sprites and each one checked their position against the neighbor, that might work

Khoa's idea has merit too even though it is aimed (ha ha) at straight lines and not arcs of plasma.

so then I would use a if instance positioning
 
Z

zircher

Guest
Yeah, I'm imagining a gun control object that maintains the list of sprites when firing and makes sure to spawn/destroy/animate/position them properly.
 
E

Emerald

Guest
alright ill try soon since this seems like it might take awhile
 
Top