GameMaker: Studio

GameMaker: Studio

View Stats:
maras Sep 2, 2016 @ 12:22pm
A small help with creating laser
Im trying to create laser with draw_line but its everytime error
Does anybody can share a code?
< >
Showing 1-3 of 3 comments
Diveyoc Sep 2, 2016 @ 1:44pm 
What kind of laser?
You have a gun and your looking to shoot laser pulses by pressing a key
or
Are you looking for a constant laser beam?
maras Sep 6, 2016 @ 5:19am 
i want laser which can be rotated, which colliding with Solid objects and when player touch them he will die
something like this at 15:47
https://www.youtube.com/watch?v=HGRWC5sBUN8
Last edited by maras; Sep 6, 2016 @ 5:21am
Diveyoc Sep 8, 2016 @ 6:45pm 
You could probably make it the same way you create a bullet. just make the spr image really long like 1000 pixel width or however long your game screen is. Then just set the speed = 0. You would have to create an end step as well so that it keeps redrawing.
You would have to remove any instance destroy command for when it hits walls or goes outside the room. Make a several frame spr to animate it with glow and such. Then you could write the damage code based on the room speed or something.
There is some code you could program the length of the beam if you wanted to.
Edit: I think distance_to_point is what you would need.
Otherwise just do some instance destroy collision events with certain object in the room for the player to hide behind and such.

As for it's movement, there's plenty of ai tutorials out there on how you could program a turret of sorts to just rotate clockwise or randomly however you want.
Last edited by Diveyoc; Sep 8, 2016 @ 6:52pm
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Sep 2, 2016 @ 12:22pm
Posts: 3