breakout 2D arcade game

Started by RemiD, November 23, 2022, 10:06:57

Previous topic - Next topic

RemiD

hi, :)

it is the winter months again here (France), so i have decided to work on an arcade game : breakout 2D.

i am going to post my progress here, and to post some code examples (blitzbasic) of things that i need to make the game.

first look of the layout of the game :
http://rd-stuff.fr/blitz3d/breakout-2d-wip-20221122-2340.png

cheers,

Steve Elliott

#1
A nice project to tackle, good luck.  :)

As per the image "Not Found - The requested URL was not found on this server."

[Edit]
The image works now good start  :)
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

RemiD

@Steve>>thanks for the encouragement !


about the screenshot, not much to see at the moment, the link works on my side...

3DzForMe

Nice to have something to focus on - the image link works fine here to in (very wet) lincolnshire.
BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

Matty

A bit like Arkanoid 2 - looks clean/neat so far the image.

RemiD

the final look will not be like this, these are just debug rectangles / oval for the layout.


i had some difficulties to get back to coding ??? , but this is coming back, one step at a time. :)

RemiD

#6
some progress :
finally my 2d orientation + movement + collision system works well  :D
after a lot of experiments and debugging ???

http://rd-stuff.fr/blitz3d/breakout-2d-wip-20221208-2251.png

on this screenshot, we can see the colliders of the walls, of the blocks, of the bouncer, of the ball.

the colliders out of range (too far from the ball) are in grey, the colliders in range (near enough the ball) are in white, the dots represents the centers of each collider.

the yellow line represents the movement vector of the ball (direction normal * speed).

the blue line represents the nearest line intersected by the movement vector.

the magenta line represents the collision normal (of the nearest intersected line).

the cyan line represents the reflection normal (the ball orientation after the collision).

good !

next step : ?

3DzForMe

BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

playniax

I am a big fan of break out games so keep it coming!

RemiD

i think that i am going to have 4 'bouncers', one for each side of the screen, all controlled using the mouse x axis and y axis,
and small blocks at the center of the screen, which cover some parts of an image.

and the goal will be to break all blocks to reveal the image, without losing the ball.

a later feature would be to generate random images, for never ending games.

RemiD

for this game i use several lists for entities (walls, bouncers, blocks, balls) (in arrays), and one list for colliders (in arrays).

i also use a few others lists (custom types) for things which are automatically destroyed (like impacts and parts).

and sometimes i have to delete one entity (a destroyed block or a lost ball) and the corresponding collider.

and i need to have a link between the entity and the collider and a link between the collider and the entity.

the problem is to reorganize the entities list and the colliders list without making errors.

so i thought about how to do it the best way...

and then i did a simple test : how much time would it take to recreate all colliders ?
answer : 0.007 millisecond to recreate all colliders (which are only x, y coordinates of centers and of starts and ends of lines)

all this to say that sometimes there is no need to find the most optimized solution !

problem solved !

RemiD

there was a nasty bug, never found the cause... :(

so i had to rewrite the code for the direction+movement and detection of collisions and repositionning, and now it works well. :)

i have reduced the size of the blocks so that they can be created and positionned depending on the colored pixels of a background image.

http://rd-stuff.fr/blitz3d/breakout-2d-wip-20221217-1152.png

3DzForMe

Looks like an incoming .bb suffix
BLitz3D, IDEal, AGK Studio, BMax, Java Code, Cerberus
Recent Hardware: Dell Laptop
Oldest Hardware: Commodore Amiga 1200 with 1084S Monitor & Blitz Basic 2.1

RemiD

QuoteLooks like an incoming .bb suffix
indeed ;D

a quick '.bb' drawing just for testing...

RemiD

#14
just to show the last update on this breakout 2d game (2023.01.05) :
http://rd-stuff.fr/blitz3d/breakout-2d-wip-20230105-1210.png

the idea was to have small blocks cover an image, and use the ball to destroy the blocks and reveal the image, and not have the ball touch the borders (using the 4 bouncers).
each time the ball touches a border it damages the ball and adds a new block to re-cover the image.
a breakout-like gameplay...

with several powerups:
-multi balls
-ball goes through blocks
-ball shoots bullets
-ball triggers explosion
-ball magnet effect (attracts the near blocks)

for the images in the background, i wanted to have simple drawings made using my tablet + pen, or maybe generated procedurally using meshes (parts), with images corresponding to a specific theme. (in this case 'old school summer babes')

maybe i will finish it someday... :-\

anyway this was interesting to code a game (prototype) only with 2d maths and 2d graphics. 8)