I'm working on a version of Super Breakout

reminisce about bbc micro & electron games like chuckie egg, repton, elite & exileRelated forum: adventures


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

I'm working on a version of Super Breakout

Post by sydney » Tue Sep 09, 2014 6:59 am

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: 3563
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 » Tue Sep 09, 2014 8:00 am

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 8:19 am
Location: FRANCE

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

Post by Zarchos » Tue Sep 09, 2014 8:40 am

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: 7551
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

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

Post by 1024MAK » Tue Sep 09, 2014 9:31 am

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
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

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

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

Post by sydney » Tue Sep 09, 2014 12:53 pm

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 84 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 1:56 pm, edited 1 time in total.

User avatar
oss003
Posts: 2749
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

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

Post by oss003 » Tue Sep 09, 2014 1:10 pm

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Wed Sep 10, 2014 1:51 pm

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Wed Sep 10, 2014 8:44 pm

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 80 times

User avatar
KarateEd
Posts: 3499
Joined: Fri Sep 20, 2013 9:15 pm
Location: Squamish, BC, Canada
Contact:

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

Post by KarateEd » Wed Sep 10, 2014 9:03 pm

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......:-)

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

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

Post by sydney » Wed Sep 24, 2014 2:09 pm

:( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :( :(
Always back up your work.
Time to start again. Yet again.

User avatar
KarateEd
Posts: 3499
Joined: Fri Sep 20, 2013 9:15 pm
Location: Squamish, BC, Canada
Contact:

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

Post by KarateEd » Wed Sep 24, 2014 3:39 pm

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......:-)

User avatar
Dave Footitt
Posts: 780
Joined: Thu Jun 22, 2006 9:31 am
Location: Abandoned Uranium Workings
Contact:

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

Post by Dave Footitt » Sun Oct 05, 2014 3:16 pm

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Tue Jun 09, 2015 7:40 pm

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 52 times

User avatar
Elminster
Posts: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Tue Jun 09, 2015 8:12 pm

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Sun Jun 21, 2015 8:23 am

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 54 times

User avatar
tricky
Posts: 2541
Joined: Tue Jun 21, 2011 8:25 am
Contact:

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

Post by tricky » Sun Jun 21, 2015 10:36 am

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Tue Jun 30, 2015 1:42 pm

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 47 times

User avatar
Elminster
Posts: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Tue Jun 30, 2015 10:09 pm

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: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Tue Jun 30, 2015 10:10 pm

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: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Tue Jun 30, 2015 10:15 pm

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: 7551
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

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

Post by 1024MAK » Wed Jul 01, 2015 6:01 am

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
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
Elminster
Posts: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Wed Jul 01, 2015 8:35 am

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Wed Jul 01, 2015 9:36 am

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: 2362
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

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

Post by Elminster » Wed Jul 01, 2015 1:03 pm

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: 2143
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne
Contact:

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

Post by sydney » Wed Jul 15, 2015 2:08 pm

Here is the updated version. I'm quite busy now but will comment on this later!
Attachments
beebout.zip
(285.71 KiB) Downloaded 43 times

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

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

Post by sydney » Wed Jul 15, 2015 7:55 pm

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 43 times

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

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

Post by sydney » Tue Jul 28, 2015 12:55 pm

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 51 times

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

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

Post by sydney » Wed Jul 29, 2015 8:00 am

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: 396
Joined: Sat Apr 03, 2010 8:16 pm
Contact:

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

Post by jbnbeeb » Thu Jul 30, 2015 7:20 pm

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?
I'm going to ..
ABUG Cambridge Sept 7th-9th Sept 2018
Image

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

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

Post by sydney » Thu Jul 30, 2015 8:21 pm

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