playMaker

Author Topic: Arkanoid kind of game (Breakout)  (Read 3668 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Arkanoid kind of game (Breakout)
« on: November 13, 2015, 11:34:09 AM »
Hi!

What is the best solution to create the ball physics in this kind of game?
I was thinking to have many triggers on the pad which makes the ball bounce in different directions depends where the ball hits the pad. If the ball hits the right edge of the pad, it's logic that the ball will bounce to the right, and so on.

Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

4ppleseed

  • Full Member
  • ***
  • Posts: 226
Re: Arkanoid kind of game (Breakout)
« Reply #1 on: November 13, 2015, 11:44:11 AM »
I think you are overthinking things with the directional triggers.

Within Unity itself (not using Playmaker) there are Physics Materials. You can add them to an object and they perform certain traits.

So, for your ball, add a Bounce Physics Material, add a rigidbody and add some velocity to it and you'll be on the right track for a Breakout style game. (Remember to turn off gravity on the Rigidbody).

Unity has a Physics Material tutorial video here:
https://unity3d.com/learn/tutorials/modules/beginner/physics/physic-materials

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arkanoid kind of game (Breakout)
« Reply #2 on: November 13, 2015, 12:11:59 PM »
Hi!

I know about Physics Materials, but how can the game know which direction the ball will bounce depending where it hits the pad?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arkanoid kind of game (Breakout)
« Reply #3 on: November 13, 2015, 12:28:09 PM »
My physic Material doesn't contain that much as in this video.
I have only:

-Dynamic Friction
-Static Friction
-Bounciness
-Friction Combine
-Bounce Combine
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

KellyRay

  • Full Member
  • ***
  • Posts: 170
Re: Arkanoid kind of game (Breakout)
« Reply #4 on: November 13, 2015, 01:38:53 PM »
If the ball is bouncing off the pad, why would you want to control the direction?

Also, you should check this out:

https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/creating-a-breakout-game

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Re: Arkanoid kind of game (Breakout)
« Reply #5 on: November 13, 2015, 02:48:09 PM »
I think this is because in most breakout games, the ball can be angled off the paddle based on it's collision position (i.e. if you hit the ball with the right half of your paddle, it bounces off moving towards the right - otherwise the entire game is a deterministic series of deflections and the player has no agency?

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Arkanoid kind of game (Breakout)
« Reply #6 on: November 13, 2015, 10:52:07 PM »
I think this is because in most breakout games, the ball can be angled off the paddle based on it's collision position (i.e. if you hit the ball with the right half of your paddle, it bounces off moving towards the right - otherwise the entire game is a deterministic series of deflections and the player has no agency?

Because as ManicMinerUK said, it depends where on the pad the ball hits.

But I think there was a package with some samples Jean Fabre ported to Playmaker. And if I don't remember wrong, there was a Breakout sample there. I don't remember the name. I'm not at my main computer right now, so I can't check.
But I will see if I can find it. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no