I'm working on a version of Super Breakout

User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

I'm working on a version of Super Breakout

Post by sydney »

I started learning about assembly language programming about a year ago but have been distracted by real life on a couple of occasions and didn't get too far. I recently restarted my Super Breakout conversion for the BBC micro and I'm at the stage where I'd like to show what I've got done so far.

I'd originally just wanted to use this project to help me to learn how to code but Tricky's fantastic conversions of arcade games has inspired me to try to produce as good a conversion of the original Super Breakout arcade game as I can.

So far I've got a basic arena drawn on the screen with a moving ball and a stationary bat. My next steps will be to introduce control of the bat with collision detection, finish up the arena and get the wall of blocks on screen. I'm hoping to get some kind of palette switching working so that I can have 6 colours on a mode 1 screen. If I don't manage that myself Tricky has kindly offered his code to achieve this.

Here is a link to a short youtube clip of where I'm at right now. I'm going to update this topic at the same time as I update my retrosoftware topic.

https://www.youtube.com/watch?v=5qZIFt9pdzQ
User avatar
richardtoohey
Posts: 4075
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: I'm working on a version of Super Breakout

Post by richardtoohey »

A very sincere =D> from me.

I really want to write a game - even some animated sprites would be a start - but I spend more time dreaming about it (that's easy!) than actually doing the hard work. So well done!
Zarchos
Posts: 2355
Joined: Sun May 19, 2013 9:19 am
Location: FRANCE

Re: I'm working on a version of Super Breakout

Post by Zarchos »

Hey that's nice !

Small bug, though :wink: when you compare position of the ball and the left bar, it's with the right side of the bar you should do the test, not the left side ...

Keep going, assembly programming is a really rewarding experience.
And keep posting your progress here, that's interesting.
User avatar
1024MAK
Posts: 12780
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: I'm working on a version of Super Breakout

Post by 1024MAK »

Zarchos wrote:Hey that's nice !

Small bug, though :wink: when you compare position of the ball and the left bar, it's with the right side of the bar you should do the test, not the left side ...

Keep going, assembly programming is a really rewarding experience.
And keep posting your progress here, that's interesting.
=D> Seconded! :mrgreen:

Mark
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

I have added controls: z - left and x - right.
I've also added some rudimentary collision detection between the ball and the bat so it is in some small way playable!

Note the attached file in an ssd not a zip. Just rename it beebout.ssd
beebout.zip
(1.75 KiB) Downloaded 239 times
edit:
The collision detection is poor is this download - I've changed the way it works and will post a new ssd later.
Last edited by sydney on Tue Sep 09, 2014 2:56 pm, edited 1 time in total.
User avatar
oss003
Posts: 3849
Joined: Tue Jul 14, 2009 12:57 pm
Location: Netherlands
Contact:

Re: I'm working on a version of Super Breakout

Post by oss003 »

Hi Richard,
richardtoohey wrote:A very sincere =D> from me.

I really want to write a game - even some animated sprites would be a start - but I spend more time dreaming about it (that's easy!) than actually doing the hard work. So well done!
Maybe you can give it a try with this program:

http://www.retrosoftware.co.uk/wiki/index.php/AADK

Looks very promising.

Greetings
Kees
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Had another go at this today and have the arena drawn in a way in which I'll easily be able to add the palette switching code to give the correct colours. I've also added a VERY basic attract screen which, over time, will develop into the high score and instructions pages. My wife is out with her sister tonight so if the kids go to bed easily I'll have another go tonight and will hopefully have the brick wall and collision detection working.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Another update.
I have the wall up and collision detection is working except I don't remove the brick on collision - I ran out of time as I have an early start tomorrow.
beebout2.zip
(2 KiB) Downloaded 204 times
User avatar
KarateEd
Posts: 6367
Joined: Fri Sep 20, 2013 10:15 pm
Location: Squamish, BC, Canada
Contact:

Re: I'm working on a version of Super Breakout

Post by KarateEd »

Looking good so far Simon, very nice work.

It's beginning to look like a game I used to play back in the day..... :lol:

I find it pretty hard to hit the ball with the paddle though.....

Ed......:-)
Ed...... :-)

3 working Beebs, 1 RetroClinic Master, 1 normal Master, 1 A3010, 1 Pi2 RISC OS, 2 broken Beeb Motherboards, 1 Omnibus A7000+ server, 1 A7000+ Desktop, 1 PET, 1 C64, 1 C128, 1 Amiga 500 and 1 Roamer.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

:( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :(
Always back up your work.
Time to start again. Yet again.
User avatar
KarateEd
Posts: 6367
Joined: Fri Sep 20, 2013 10:15 pm
Location: Squamish, BC, Canada
Contact:

Re: I'm working on a version of Super Breakout

Post by KarateEd »

Oh man, sorry to hear that.... you didn't by chance give someone the source code to look at/check something out somewhere along the way?

That could save you some work.....

Ed......:-)
Ed...... :-)

3 working Beebs, 1 RetroClinic Master, 1 normal Master, 1 A3010, 1 Pi2 RISC OS, 2 broken Beeb Motherboards, 1 Omnibus A7000+ server, 1 A7000+ Desktop, 1 PET, 1 C64, 1 C128, 1 Amiga 500 and 1 Roamer.
User avatar
Dave Footitt
Posts: 998
Joined: Thu Jun 22, 2006 10:31 am
Location: Abandoned Uranium Workings
Contact:

Re: I'm working on a version of Super Breakout

Post by Dave Footitt »

sydney wrote: Always back up your work.
Time to start again. Yet again.
Bah, that's rough, and all the more frustrating when time is at such a premium these days.

Could be worth checking out Mercurial or Git for source control? Make sure you push your changes remotely now and then, or even set up a GitHub account.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

I'm back working on this again! I'm hoping to have something playable for the ABug meeting in less than 2 weeks and hopefully have it finished by the end of July.
There is not a lot to see at the moment but the controls work and the bat moves and thats about it! I'm hoping to get an hour or two to work on it tomorrow so I'm focusing on getting the ball moving with collision detection with the walls and bat. It's all a bit monochrome too but I'm hopefully going to use some palette switching to allow more than 4 colours in mode 1.
Attachments
beebout.zip
(6.69 KiB) Downloaded 154 times
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

I will keep an eye on progress for my own learning.

Another idea that would interesting (possibly only for me) is doing a hires version, mainly to give something to test out my WE 32 RAM (shadow)board (and I guess the new Prime Master RAM Boards).
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

I did a bit of work on the collision detection while in Bolton yesterday. It wasn't working as I though it would so left it as it was. I woke up this morning and realised where I was making a mistake and lo and behold it works! I often find solutions to problems when I stop thinking about them. Collision with the bat is not quite right but I know how to easily address that.
Next jobs are to reset the ball position and wait for space to be pressed when the ball gets past the bat and remove bricks when the ball hits them. First job is quite easy and the second I struggled with in the project I lost.

Instructions:

At the blank screen press d,c or p to select game type - make no difference which on you press at the moment.
Once the wall and bat are displayed press space to release the ball.
Z and X are left and right.
Attachments
beebout.zip
(10.25 KiB) Downloaded 132 times
User avatar
tricky
Posts: 7693
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: I'm working on a version of Super Breakout

Post by tricky »

Elminster wrote:... give something to test out my WE 32 RAM (shadow)board (and I guess the new Prime Master RAM Boards).
I don't mean to highjack your thread, but my Astroblaster is WE compatible and should have speech - three phrases for 32K WE RAM (2/4 for 16/32K SW RAM)
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Here is the latest version. Lots of bugs still but some better collision detection now. Press escape to restart otherwise controls are as posted above. Feedback welcomed.
Attachments
beebout.zip
(199.93 KiB) Downloaded 116 times
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

tricky wrote:
Elminster wrote:... give something to test out my WE 32 RAM (shadow)board (and I guess the new Prime Master RAM Boards).
I don't mean to highjack your thread, but my Astroblaster is WE compatible and should have speech - three phrases for 32K WE RAM (2/4 for 16/32K SW RAM)
The WE equipped Beeb also has Speech chips, think I remember reading one of your threads about adding speech. Will have to catchup with Beeb games. Must admit I never seem to have much time for games these days. All I ever play is Skylanders trap team and Disney Infinity 1 & 2 on the Wii U, but even then only when my daughter wants to do two players.
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

sydney wrote:Here is the latest version. Lots of bugs still but some better collision detection now. Press escape to restart otherwise controls are as posted above. Feedback welcomed.
Getting there. I have donwloaded every version so far, but still on my todo list to a) play it b) work out how it works!
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

sydney wrote:I started learning about assembly language programming about a year ago but have been distracted by real life on a couple of occasions and didn't get too far. I recently restarted my Super Breakout conversion for the BBC micro and I'm at the stage where I'd like to show what I've got done so far.
Do you remember at Wakefield you said for learning assembly you found book xxxxxxx very useful, but could remember the title? Just wondered if you have since remembered it. I have a quite a few assembly books now, just wondered if it was one I had in paper or electronic form.

Read a few new, currently reading Dr Watson and Bruce's ROM Book.
User avatar
1024MAK
Posts: 12780
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: I'm working on a version of Super Breakout

Post by 1024MAK »

I find that learning how to use most of the M/C instructions is not that hard.
The difficult bit is working out how to best use the available instructions to do what you want, without the code becoming a mess.

That's where it is useful to see how others have done it. But really need really well commented source code for that.

Some hints and tips from experienced programmers are always nice.

Mark
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

Much like learning any language. Learning what the words mean/do is not the same as speaking fluent French.

While I have got as far as knowing what all the commands are, and can some sometimes even remember the syntax for the various addressing schemes. When trying to dissemble stuff (i.e. no comments or labels) I often have no idea why it does something to a certain address. Then it is time to get out user guide, advanced user guide and look on mdfs.net time.

So far I have found Bruce Smith's ROM book quite useful for those 'Ah so that is what people do that !' type moments. The learning assembly ABC books dont usally cover that and the advance 6502 books dont cover Beeb specific stuff. Just have to read all of them and practice for a few years.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

I can't for the life of me remember the book. When I first started this project I'd spent many months (years?) reading 'teach yourself 6502 assembly language' type books so had a pretty good understanding of the instruction set but not quite as good an understanding of the addressing modes. I found them a good way to learn the basics but not too good at teaching you how to actually do anything. I only really began to understand it once I tried to solve a problem with it.
The first step is deciding what you want to do. Then break it down into the smallest pieces possible. I used the example sprite routine from retrosoftware as even this was beyond my abilities at the start (probably still is now!).
The next step is to have a useable programming environment. Swift is good but I prefer using Beebasm and that was easier to use with notepad++. I tried developing on a beeb but found the old school BASIC assembler too hard to edit easily and even using edit or view was a bit of a pain as I'm used to modern editors. Not to mention how long assembling a long program would take.
I would sit at my pc with the user guide, advanced user guide, creative assembler and other books and use them as a reference - every time I got stuck, which was often, I'd open a book or a website and figure out where I was going wrong. I also printed out onto card and then laminated a 6502 reference card which helped a lot, I'll attach it to this post.
Reading other peoples code is difficult if not commented. I can see what they are doing but often don't know why. This is where the user guide/aug come in handy. If you want to ask any questions about my code feel free I'd be happy to answer and will probably learn something myself.
I'm not sure what I really wanted to say in this post other than just do it. Pick a game or a task or whatever and just figure out how to do it. I wrote about 4 A4 sides on how to implement the game - going into the smallest detail I could imagine - before I started then just did it. One pixel on screen, then a ball, then moved it horizontally, then vertically, then reversed direction at the edge of the screen etc. Each step was a tiny addition but after 100 tiny additions you end up with something that works.
User avatar
Elminster
Posts: 4315
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: I'm working on a version of Super Breakout

Post by Elminster »

Great thanks. I have most of the 6502 books ever written now (seemingly, actually about 12 + some electronic ones + various one that mention assembly like the user guide etc.). Just finding time to work through them. If some were particularly better than other I would priorities them. Although I do have the reviews for most of them from Beebug Mags so can guess.

I am using Textwrangler in Mac and then either use Beebasm or more often I then just import into beebem and exec it. So more or less the same.

I would agree Assembly is pretty much easier apart from remembering how all the addressing mode work. And then the practicality of the Beeb system calls.

BTW. My current task is disassembling to produce source for some ROMs. It is quite hard as an initial task.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Here is the updated version. I'm quite busy now but will comment on this later!
Attachments
beebout.zip
(285.71 KiB) Downloaded 130 times
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Yet another version!
I have added a simple attract screen, scoring, lives and a high score. I hope to have Joystick controls and sound effects working by the end of the week. I stole a few subroutines from jbnbeeb's JSnake but they were pretty simple so I don't think he'll mind.

Still a few bugs to iron out and you get points for hitting the ball with the bat which I quite like so it's staying in!

I'll try to post a video later.

Starting to look like a game now!
Attachments
beebout.zip
(294.8 KiB) Downloaded 128 times
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

I think I'm going to declare this project finished!
The game has 8 levels, you start on a random level then progress (Ha! Not likely!) throught them in numerical order. The zip file contains a disk image and another zip file which contains the source code and less usable disk image.

I didn't get round to adding joystick control or removing the cursor. The collision detection is also a bit iffy and some levels may seem to have indestructable bricks but should still be completeable. There is also a bug which occurs after starting the game about 15 times where no level appears. I doubt anyone will play it enough times to get to this bug so I'm just going to leave it. Rebooting solves it!

All in all I'm reasonably happy with the game and very happy with the learning experience! I still have a lot to learn but I know a lot more than I did before starting this.

I'd like to thank Tricky and jbnbeeb for the help and encouragement they offered.
splash.png
menu.png
level2.png
level3.png
level4.png
level5.png
level6.png
level7.png
level8.png
Attachments
beebout.zip
(49.44 KiB) Downloaded 146 times
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Oops! :o Found another bug. The ball can break through the arena in the top left corner (and probably the right) I'm not particularly happy with the collision detection in general so may completely rewrite it. :(
User avatar
jbnbeeb
Posts: 598
Joined: Sat Apr 03, 2010 9:16 pm
Contact:

Re: I'm working on a version of Super Breakout

Post by jbnbeeb »

Hi Simon, I kept meaning to respond to this. I downloaded and played your latest version. Big =D> =D> =D> =D> . Code is fairly well structured, well commented and easy to follow. Plays nicely :)


Oops! :o Found another bug. The ball can break through the arena in the top left corner (and probably the right)
..though yup I did find ball broke through arena on both left and right sides. :shock: .. also found that sometimes I could bounce off a brick without it disappearing - but that was rarer than the ball-through-arena-boundary bug.

I know you're keen to move on.. perhaps a satisfying way to put the lid on it would be to fix the boundary problem.. and remove that cursor as a nice finishing touch?
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: I'm working on a version of Super Breakout

Post by sydney »

Thanks Jason. I'm happy with my code but know it could be laid out better and I'm sure my next attempt will be a lot better.
The non dissapearing ball is caused by a bodge to the code which stopped the ball travelling along gaps between rows of bricks, I could solve it with another bodge as well as a bodge to fix the ball breaking through the arena. Too many bodges so I'm going to rewrite all of the collision detection code as I've never been that happy with it and it kind of evolved rather than being planned. I've had a good think about it and I'm pretty sure I can make it work correctly. The only real problems are (1) time - I have a week off next week but my wife has a very busy week planned so probably won't get near a computer - and (2) I have 3 projects i mind which I can't decide between!
Post Reply

Return to “new bbc and electron games from 'retro software'”