I'm not sure what you mean by a short burst laser (do you want one that shoots like a blaster pistol might or one that is a continuous line, like a real laser, but which fades out over distance), but this should not be difficult.
You probably should have a separate varaible defining your character's facing direction, incase you want to go back later and change sprites or something, but either way, you'll want to do something with a switch statement:
switch (sprite_index)
{
case sPCWalkingRight:
//create the laser to the right
break;
case sPCWalkingDown:
//create the laser down
break;
//etc...
}
The switch statement is basically a bunch of if statements smashed together. It compares the variable given (in this case, sprite_index), with each "case," and, if a match is found, executes the code below that "case" until a "break" statement is reached.
As for drawing the actual laser, you'll probably end up using draw_line, but you can also use a sprite and scale it to produce a similar effect with the added benefit of being able to better control how your laser looks. I'd need to know more about what exactly you're looking for.



Find content
Male
