r/ArduinoProjects • • Sep 14 '22

First attempt at a breakout game...

178 Upvotes

11 comments sorted by

6

u/[deleted] Sep 14 '22

Was inspired by a comment on my Etch a Sketch project post and a link someone shared with me this week to Google's version of the game. Plenty of kinks still to sort out though...

3

u/[deleted] Sep 15 '22

Main issue I saw that was bugging me was the angles in which the ball bounced off the walls and the bar. It seemed to be at the same angle every time and it seemed like the direction of the ball had no impact on which the ball bounced off

1

u/[deleted] Sep 15 '22

Yes...well spotted. It's because I've so far only split the player in half, with x += 1 and x -= 1...I need to make this a little more sophisticated to mix up those angles when the balls hits different parts of the player.

6

u/AppliedArt Sep 14 '22

That's awesome. I have been programming on arduino's for years and never wrote anything that cool. Good job!

1

u/[deleted] Sep 15 '22

Thanks! Just trying to get to grips with this C++ stuff, pretty new to it still.

5

u/Depresso137 Sep 15 '22

Really interesting.. how did you create the continous motion of the ball without having to recolour the display? I worked on a digital bubble gauge with a display and an arduino where I had to recolour the screen to show the new position of the bubble and I never found a solution to make it move continuisly without black frames in between each measurement..

3

u/[deleted] Sep 15 '22

In the ball struct there are variables for the previous X and Y, which I used to remove it's last position before redrawing it again in the new one. I've found that it's best to only draw and update the pixels that you need, as these screens are super slow otherwise.

1

u/Houdinii1984 Sep 15 '22

Yesterday I built breakout for Windows using Unity and was exceptionally proud of myself. Can't imagine how "fun" it would be if I introduced memory constraints and pointers, lol. Awesome stuff.

1

u/xxqsgg Sep 15 '22

Great job!

BTW, there are slide potentiometers on sale, they make the control easier. Like this one here

https://a.aliexpress.com/_mrHGj16

1

u/[deleted] Sep 15 '22

[removed] — view removed comment

1

u/[deleted] Sep 15 '22

No worries. eBay if I'm not feeling patient, or AliExpress if I can wait - they're way cheaper there, like 1/3 of the cost if you can wait a week or do for delivery.