I am looking for a little bit of help in regards to coding the logic of some level elements.
I have started to bring in some elements to my game to test some idea's and I am struggling on how to code them and give them functionality.
I have a saw in my game which is an obstacle the player must dodge and not get hit by. The saw is something I want to move up, down, left and right. I have seen some tutorials which use sprites as boundaries in order to keep the AI in specific area's. I have a simple set up at the moment here is a screenshot.
The saw for this section of my game I want to move up and down, but I have other sections where I want the saw to move horizontally as well. I did get the saw moving horizontally through a simple event which basically stated
if the saw is > 0, set y position, 415.
This got my saw in the correct position and with the platformer behavior I simulated left and right movement through a global variable called 'Patrol' (0 was left and 1 was right). I don't know if this is the best way but it did work as I wanted in regards to the movement of the saw my only problem was I was unable to get the saw moving vertically when I wanted. I was thinking of using separate event sheets but then I thought that just complicated things and wouldn't really be the best solution to how I want to use the saw throughout my game.
I guess what I am asking here is, would it be possible to have an object move on its own in multiple directions? I am struggling to work out the logic and what behaviors to use.