trojectory
Member
Hey all,
I'm a developer but haven't done much with game development and GameMaker Studio 2 for much longer than a few weeks. I'm recreating an old game that is a spin on the class ball-breaks-bricks game. It's more complicated then that but that's the idea.
I have about 14 different bricks that all have different sprites and different behaviour when the ball collides with them. I've designed a ball and 14 different objects, and need to create collision events between the ball and each of the bricks. I'm trying to avoid copying-and-pasting the logic (it works just fine) that will calculate the ball's rebounding angle/speed into each of the collision events. Any ideas or better way to design it?
My very first attempt was to put all the collision events between the ball and the different bricks, on the ball itself, but then (as far as I know) I couldn't put that rebound logic in a parent brick object which was another idea. I feel like I'm missing something.
I'm a developer but haven't done much with game development and GameMaker Studio 2 for much longer than a few weeks. I'm recreating an old game that is a spin on the class ball-breaks-bricks game. It's more complicated then that but that's the idea.
I have about 14 different bricks that all have different sprites and different behaviour when the ball collides with them. I've designed a ball and 14 different objects, and need to create collision events between the ball and each of the bricks. I'm trying to avoid copying-and-pasting the logic (it works just fine) that will calculate the ball's rebounding angle/speed into each of the collision events. Any ideas or better way to design it?
My very first attempt was to put all the collision events between the ball and the different bricks, on the ball itself, but then (as far as I know) I couldn't put that rebound logic in a parent brick object which was another idea. I feel like I'm missing something.