breakout clone concepts

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
amateus
Member
Posts: 46
Joined: Fri Nov 15, 2019 9:13 am

breakout clone concepts

Post by amateus »

Hi all,

I've been working on a breakout clone (there aren't many :P) to allow me to understand how z88dk and sp1 works.

I have a somewhat working level (ball, pad, collisions, tiles etc), but I wonder how the more experienced with sp1 would approached tiles.

I have experimented with sprites, thinking I couldn't have that many. I actually find out that I had more problems with the loading time (creating the sprites and placing takes around 20s) than with numbers, and the game was smooth with 88 sprites plus ball and pad. Pretty damn impressive I have to say.

I have tried with tiles, which is way faster, of course, but I had a few issues with some features I wanted to add, for example, having some stars moving down to simulate some sort of scroll, as those starts appears on top of the tiles, among others, or tile animation.

So, my question is, if you wanted to make a breakout clone, how would you approach the tiles? As an example, Arkanoid had a max of 132 tiles at some point.

Thank you
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: breakout clone concepts

Post by Timmy »

amateus wrote: Thu Dec 10, 2020 11:05 am I have tried with tiles, which is way faster, of course, but I had a few issues with some features I wanted to add, for example, having some stars moving down to simulate some sort of scroll, as those starts appears on top of the tiles, among others, or tile animation.
Tiles also use less memory than sprites.

Anyway, I don't understand what kind of features or issues you wanted to add.

Sprites are always drawn on top of tiles. If you want sprites not to be drawn on certain locations, then don't invalidate those squares. (You know how to do that now :p ) A side effect is that the tiles on those squares will not be updated as well.
So, my question is, if you wanted to make a breakout clone, how would you approach the tiles? As an example, Arkanoid had a max of 132 tiles at some point.
Not completely sure what you're trying to say, but let me quote something from the wiki: https://github.com/z88dk/z88dk/wiki/sp1
SP1 understands two graphical entities: background tiles and sprites. Background tiles can either be a single byte character code (for example the letter 'A') or an absolute memory address from which background graphics for that cell are copied. Single byte character codes allow string printing and quick background animation effects; the graphics associated with each such character code is redefinable and is initialized to point into the platform's native character set where possible. Using an absolute memory address to specify background graphics allows a secondary display file to be set up as background. Background of specific character cells can be freely specified as character code or absolute address at any time.
You can have basically 1000s of tiles if you want to, the Spectrum doesn't really have a concept of tiles. Of course that would give problems when you have to port to other platforms but sp1 isn't really portable anyway.
amateus
Member
Posts: 46
Joined: Fri Nov 15, 2019 9:13 am

Re: breakout clone concepts

Post by amateus »

Hi Timmy,

Thanks for the input.

My question was more towards the approach more experienced users would take, for example using background tiles for... tiles vs sprites,not code itself :)
User avatar
jorgegv
Well known member
Posts: 287
Joined: Wed Nov 18, 2020 5:08 pm

Re: breakout clone concepts

Post by jorgegv »

I would use Tiles for non-moving things (e.g. the bricks), and sprites for the moving ones (ball, pad, enemies, power capsules, etc).

As Timmy already told you, there's no limit on the number of tiles (besides fitting in memory), and if you have fewer sprites they can be bigger, have more effects, animations, etc.

You can also set aside a map for the state of each tiles (visible, inactive, etc.) And make the ball movement check this map to choose if It needs to bounce or go straight, etc.

I have implemented a similar technique in my RAGE1 engine to detect if a tile is an obstacle or not, and allow the Hero Sprite to move over It or not.

J.
amateus
Member
Posts: 46
Joined: Fri Nov 15, 2019 9:13 am

Re: breakout clone concepts

Post by amateus »

Yes thanks jorgegv, I'm doing exactly that :)
Post Reply