TheJoe
Member
Hi everyone!
This is my first time posting but I've been working with GML & Gamemaker for about a year and a half now. For a little background I'm a total hobbyist, no coding experience other than some batch files in DOS when I was way young, and just make games for my friends (this one is for a wedding present for my friends who are REALLY into their dog).
For some reason I've always had a really hard time making cutscenes and I'd love if I could get a second pair of eyes on a bit of code I wrote for one. While I'm really excited for Sequences, I need to finish this wedding present before I'll have access, and so lo and behold I finally stumble upon Paths as a potentially great solution. I'm wondering to myself why nobody has any tutorials out there on them or why they're not mentioned much in the forums or tutorials, but now after been banging my head against my desk trying to get them to do what I want, I think I might get why (ex. I first tried this with a switch statement for path_position and that led me down a dark nightmarish hellscape hole, and why isn't it easier to fire events at a point in the path?).
Sorry for the long preamble! Here's the working code and my question is, is there a better way to achieve this? Small scene where a dog walks into view, does some doggy stuff.
Since I've been working in a total vacuum for my entire coding life, I write this stuff and think to myself 'Joe, while this works, you're probably coding like a dummy."
Really appreciate any thoughts or recommendations!
(PS I've implemented FriendlyCosmonaut's Cutscene system in a previous project and it just seemed like overkill for the stuff I do.)
This is my first time posting but I've been working with GML & Gamemaker for about a year and a half now. For a little background I'm a total hobbyist, no coding experience other than some batch files in DOS when I was way young, and just make games for my friends (this one is for a wedding present for my friends who are REALLY into their dog).
For some reason I've always had a really hard time making cutscenes and I'd love if I could get a second pair of eyes on a bit of code I wrote for one. While I'm really excited for Sequences, I need to finish this wedding present before I'll have access, and so lo and behold I finally stumble upon Paths as a potentially great solution. I'm wondering to myself why nobody has any tutorials out there on them or why they're not mentioned much in the forums or tutorials, but now after been banging my head against my desk trying to get them to do what I want, I think I might get why (ex. I first tried this with a switch statement for path_position and that led me down a dark nightmarish hellscape hole, and why isn't it easier to fire events at a point in the path?).
Sorry for the long preamble! Here's the working code and my question is, is there a better way to achieve this? Small scene where a dog walks into view, does some doggy stuff.
GML:
timer++;
//Dog turns around to wait, barks
if timer >= 120
{
image_xscale = 1;
sprite_index = s_dog_bark;
path_speed = 0;
}
//Dog sits down and pants
if timer >= 240
{
sprite_index = s_dog_sit_pant;
}
//Dog turns around and walks away
if timer >= 500
{
path_speed = 1;
sprite_index = s_dog_walk;
image_xscale = -1;
}
//Dog waits standing and panting
if timer >= 750
{
path_speed = 0;
sprite_index = s_dog_stand_pant
}
Really appreciate any thoughts or recommendations!
(PS I've implemented FriendlyCosmonaut's Cutscene system in a previous project and it just seemed like overkill for the stuff I do.)