Break a Noid - a shameless Arkanoid/Breakout clone

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
Cucurbitacée
Prole
Posts: 47
Joined: Fri Dec 14, 2012 10:22 am
Location: Frankfurt am Main

Break a Noid - a shameless Arkanoid/Breakout clone

Post by Cucurbitacée »

Hi everyone,

After getting lost myself in project too big for the beginner I am, I decided to go for a simpler project: a Breakout/Arkanoid clone. After doing the the engine in a few hours, I couldn't help myself and had to make an editor that took me days and days to complete. Anyway, first, some stuff for the eyes: :awesome:

The title/main screen:
Image

Some gameplay:
Image

The editor:
Image

And a video of the 3 first levels (yes they are complete rip-off Arkanoid):


The game is playable and the 30 levels can be completed (at least in easy mode). There are still a lot of bugs around, please don't press any key during result screen. :huh:
But my main problem is that the "physics" is not really working the way I want it to be. I use Hardon Collider for collision management. And I think my problem comes from a misunderstanding of the library.
The global idea is that only the paddle is able to fully change the angle of the ball. Hitting the walls or a brick will mirror the angle. The problem is that often the ball will go through some bricks...
Here is the code I use to change the angle of the ball when it hit a brick, where dx and dy are the displacement vectors provided by Hardon Collider, b is the ball and x and y are the center of the 64*32 pixels brick:

Code: Select all

if y < b.y then -- ball is under the brick.
	if b.x - x >= 32 then --ball is on the right
		b.angle = 180 - b.angle
		b.x = b.x + dx
		b.y = b.y + dy
	elseif b.x - x <= -32 then --ball is on the left
		b.angle = 180 - b.angle
		b.x = b.x - dx
		b.y = b.y + dy
	else --ball is fully under
		b.angle = 0 - b.angle
		b.y = b.y + dy
	end
else -- ball is over the brick
	if b.x - x >= 32 then --ball is on the right
		b.angle = 180 - b.angle
		b.x = b.x + dx
		b.y = b.y - dy
	elseif b.x - x <= -32 then --ball is on the left
		b.angle = 180 - b.angle
		b.x = b.x - dx
		b.y = b.y - dy
	else --ball is fully over
		b.angle = 0 - b.angle
		b.y = b.y - dy
	end
end
Thanks for reading this, and even more thanks if you gave the game a try. I'd take any advice/critic. :neko:
Attachments
Breakanoid.love
(923.41 KiB) Downloaded 196 times
Germanunkol
Party member
Posts: 712
Joined: Fri Jun 22, 2012 4:54 pm
Contact:

Re: Break a Noid - a shameless Arkanoid/Breakout clone

Post by Germanunkol »

Neat, I like breakout games!

This is really polished. Well done. I gotta stop playing now because I have to go study... Got to level 6.
It works very well and it's fun. Everyone, give this one a spin!

Minor issues:
  • Once, the ball got split up into three balls and one of them was moving perfectly horizontal. I could never touch that ball again, and after a while it didn't help me any more because all bricks in that line were erased. Maybe add a very small downward angle at each wall collision, or add a tiny bit of a random value. (I won that level anyways, but only because I had other balls left. If that had been the only one, I would have had to restart the level)
  • Maybe it should auto-save after each level and allow me to reload at that stage later?
  • Very seldomly, the ball would get caught between two unbreakable blocks and bounce off in an (to me) unpredicable direction.
  • I didn't like that upgrades aren't stackable. I prefer the version where there are up- and downgrades for pretty much every "ability" (speed, paddle-size), or some (like the laser) just stop after a while. This is just personal taste though, so I'm only adding this to provoke some thoughts, not as a thing you should really change.
Well done!
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
User avatar
Cucurbitacée
Prole
Posts: 47
Joined: Fri Dec 14, 2012 10:22 am
Location: Frankfurt am Main

Re: Break a Noid - a shameless Arkanoid/Breakout clone

Post by Cucurbitacée »

Germanunkol wrote:Neat, I like breakout games!

This is really polished. Well done. I gotta stop playing now because I have to go study... Got to level 6.
It works very well and it's fun. Everyone, give this one a spin!
Thanks a lot. :awesome:
Germanunkol wrote:Once, the ball got split up into three balls and one of them was moving perfectly horizontal. I could never touch that ball again, and after a while it didn't help me any more because all bricks in that line were erased. Maybe add a very small downward angle at each wall collision, or add a tiny bit of a random value. (I won that level anyways, but only because I had other balls left. If that had been the only one, I would have had to restart the level)
Damn, that's a fail in my code. When a ball splits the angles of the new balls are the previous +10° and -10°. If the new angle is below 5° (or -5°) it should normally adjust to this value. I will investigate this issue. Thanks. :3 On a side note, after 100 bounces without touching the paddle, the ball will be eject at a random angle. This is not very elegant but it avoid being in a loop. I'd like to add a repetitive pattern detection, but that may be above my capacities.
Germanunkol wrote:Maybe it should auto-save after each level and allow me to reload at that stage later?
That's something I'm still undeciced. On one hand I want to keep the retro coin-op feeling where you must beat the game in one credit, on the other hand it's not the kind of behaviour you'd expect in a modern game. Maybe I should a "normal" mode with save point between levels and an arcade mode with continues... I'll think about it.
Germanunkol wrote:Very seldomly, the ball would get caught between two unbreakable blocks and bounce off in an (to me) unpredicable direction.
That's my main problem at the moment. As I said in my first post, I don't fully understand Hardon Collider, I need to read more to get better collision handling.
Germanunkol wrote:I didn't like that upgrades aren't stackable. I prefer the version where there are up- and downgrades for pretty much every "ability" (speed, paddle-size), or some (like the laser) just stop after a while. This is just personal taste though, so I'm only adding this to provoke some thoughts, not as a thing you should really change.
Personnaly I really like this way, especially when you have a megaball and options are litterally raining over the paddle and you have to avoid them while keeping an eye on the ball. It really add tension to the game. :megagrin:
Germanunkol wrote:Well done!
Thanks again. :nyu:
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Break a Noid - a shameless Arkanoid/Breakout clone

Post by ArchAngel075 »

Damn, that's a fail in my code. When a ball splits the angles of the new balls are the previous +10° and -10°. If the new angle is below 5° (or -5°) it should normally adjust to this value. .......
Perhaps track the angle of incident the ball collides at, and then if the next collide is a inverse of it (angleDegreesLastCollide+180) then add a slight math.random to the actual angle it bounces off on, this way any angles causing a perfect bound back can be avoided,
Of-course you can also say only if the event occurred n times so that bouncing a ball straight up and down to paddle is a valid method.

Have fun! Been awhile since playing one of these fun crazes!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests