Jump to content
AndyMt

New game uploaded: Brixx

Recommended Posts

Brixx

View File

Screenshot-01-small.png

This is a Breakout/Blockout/Arkanoid inspired game. 😀. It is my very first try on the X16.
You have to use a mouse or a joystick (cursor keys + enter on the emulator)

It's only tested it on the emulator (R37, R38), so if anyone of the few with real hardware can give it a go, I'm eager to know the result.

Available power ups (no keycodes, you have to catch the dropping badges):

  • [L]: adds one live to player
  • [M]: paddle is magnetic for 30 seconds. Can only hold one ball at a time.
  • [C]: twin laser cannon for 15 seconds, 16 rounds in a row (if you are quick).
  • [D]:Duplicates ball, so now you can have fun with 2...

Keyboard commands:

  • 's': sound on/off.
  • 'q': quit game.

How to use with the local emulator:

  1. Unpack ZIP file into the same directory as the emulator.
  2. Start the emulator, then enter
  3. LOAD"BRIXX.PRG"
  4. RUN

Let me know what you think...


 

  • Like 5

Share this post


Link to post
Share on other sites

This looks great! I'll have to try it out some more when I have some time. I actually wanted to create a game like this for the X16 just so it would exist, but it got pushed too far back on my priority list. Thanks for doing it and doing such a nice job!

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Even though it's a prototype, I agree it's fairly well done! There seems to be a small bug that sometimes the walls can be replaced with the background tile, and it seems to be possible for the ball to sneak past the paddle in the bottom left corner. But overall, very good, and thanks!

Edited by StephenHorn
  • Like 1

Share this post


Link to post
Share on other sites

Thanks @StephenHorn. Yes - the collision detection is still a bit shaky. I tried to optimize it as much as possible by just using the character positions when checking for a bounce. That's an issue if the ball travels over a corner by more than 1 pixels at a time...

If first wanted to use sprites for the bricks coming up in the trajectory and then have Vera detect collisions...  until I read that the emulator doesn't detect them, right?

Share this post


Link to post
Share on other sites

Correct, the emulator doesn't do collision detection yet. I submitted a pull request quite a while back to address this, but I may have implemented it backwards and as far as I can tell nobody has looked at it, much less accepted it.

It may be difficult to implement the blocks via sprites, anyhow, as you may find yourself bumping up against the VERA's per-line sprite limitations. The emulator does replicate that behavior. If you wanted the background to be visible behind the tiles, you might consider using the second layer to display the bricks on their own tilemap.

Share this post


Link to post
Share on other sites

Trusting the hardware collision detection is risky, anyway. It's best to implement your intersection formula yourself. There is plenty of time to have the CPU do the math.

Share this post


Link to post
Share on other sites
1 hour ago, StephenHorn said:

[...]

It may be difficult to implement the blocks via sprites, anyhow, as you may find yourself bumping up against the VERA's per-line sprite limitations. The emulator does replicate that behavior. If you wanted the background to be visible behind the tiles, you might consider using the second layer to display the bricks on their own tilemap.

I just wanted to use a maximum of 3 potential sprites in line with the trajectory at the same positions as the tiles (just using the same bitmaps as the sprites). The player would not notice.

The 2nd layer I'd like to make use of to do some parallax effects - just because Vera can 🙂. I struggled getting it to work (black screen only), so I left it out for now.

34 minutes ago, SlithyMatt said:

Trusting the hardware collision detection is risky, anyway. It's best to implement your intersection formula yourself. There is plenty of time to have the CPU do the math.

Ah I see - your're probably right. Doing it myself also teaches me someting. And at 8MHz... if we just had this speed back then... Ok my trusty Atari ST did, but it didn't have any hardware acceleration like Vera provides. 

  • Like 2

Share this post


Link to post
Share on other sites

Ok, I've uploaded a new version with improved collision detection. I hope I understood the way I'm supposed to replace the PRG in the software library with a new version 🙂.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, AndyMt said:

Ok, I've uploaded a new version with improved collision detection. I hope I understood the way I'm supposed to replace the PRG in the software library with a new version 🙂.

The updated version appears correctly here 🙂

Love the mouse support!

Share this post


Link to post
Share on other sites

Uploaded a new version (0.2). This one now uses BIN files to load the palette, sprites and tile set. I managed to create some artwork which (in my opinion) makes the game already appear to look a lot more like Arkanoid back in the days 🙂.

I made it more difficult for myself by using 4bpb tiles in a 256 color palette I've designed myself. Then using color offsets (multiple of 16) I now can easily recolor all the bricks just by moving them in the color palette :).

Next topic is sound... Something I have zero experience.

I consider changing the layout of the playing field to be more square and show score, lives etc on the right hand side (similar to Arkanoid). Right now I think there are just too many bricks on the screen - it takes ages to complete a level...

What do you think?

  • Like 1

Share this post


Link to post
Share on other sites

Just played the level. It looks and plays great. But it doesn't seem to be possible to get the ball to go up again after it started to bounce mostly sideways. But maybe I'm just a bad player.

Share this post


Link to post
Share on other sites

The angle can be modified by letting the ball hit the paddle more at the sides. If ball is coming from the right and hits the left hand third of the paddle then it is redirected in a more steep angle. That way you can get it back upwards. Imagine the paddle is curved.

I consider to change that to be depending on the movement of the paddle. So the ball would inherit some impulse from the paddle movement. Not sure how Arkanoid worked...

  • Like 1

Share this post


Link to post
Share on other sites

I don't think Arkanoid did that, but I remember playing a clone in the MS-DOS days and I remember that paddle/ball interaction wasn't really physically plausible, but it was fun. By the way, we're in the same timezone. 🙂

  • Like 1

Share this post


Link to post
Share on other sites

If you need the ball to go up, just right-click. 😉

The improvements look great! The one thing that sticks out to me is that I wish the paddle had even more influence over the horizontal movement of the ball. The ball clearly gets some horizontal component added to it based on where it strikes the paddle, but I wish this influence were even stronger, or just straight-up assigned a velocity instead of influencing the existing one.

To get right at the point, I really wish that when I narrowly miss a block near the edge of the screen, I could bounce the ball off paddle to reflect the ball back and take another shot at the missed block right away at a hopefully similar (but not exact) angle. Right now, I feel like I have to bounce the ball across the entire width of the screen, because it's just about impossible for the paddle to influence the ball enough to actually reflect it back in the direction it came from.

  • Like 1

Share this post


Link to post
Share on other sites

Definitely fun to play, well done! Playing with the web emulator the mouse sometimes gets outside of the canvas. I will look into fixing this and keep the mouse captive to the emulator area.

  • Like 1

Share this post


Link to post
Share on other sites

Yes, using the mouse with the emulator is tricky. It would need to continue reporting mouse positions to the prg even if the mouse is outside of the window. That also applies to the native emulator on Windows, it also happens there.

  • Like 1

Share this post


Link to post
Share on other sites

Uploaded a new version (0.3). Now we have some additional levels 🙂.

I also improved the collision detection further. The paddle now allows to control the ball so that it almost moves in a vertical line. Not entirely - that would be too easy, right 😉?

Some cheat codes added, too:

  • l: level switch - this way you can check all the levels without playing them
  • a: autoplay - for testing collision detection

Have fun!

I'll upload the source code to github at some point - but I want to do some proper cleanup first. All code is inside a file named "cc65test.c" 🤣 atm.

I started with sound effects - but Vera's PSG doesn't provide me with the effects I'd like. So I also tried the YM2151, but that's a lot more complicated. Any easy way to get sound effects from some sort of library and a "player"?

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, AndyMt said:

Any easy way to get sound effects from some sort of library and a "player"?

You can take a look at the code I wrote for XCI to playback PCM sound samples. That's the easiest way, as you can just download or make recorded sound effects and use Audacity to resample them to whatever rate you want to use. Now, this method will take by far the most amount of RAM, as you have to be able to load the entire sample from disk and play it back over time, but it gives you exactly what you want.

You can see my code for playback on GitHub: https://github.com/SlithyMatt/x16-xci/blob/master/engine/sfx.asm

And you can see how I download and convert free sound effects in this video: 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@SlithyMatt Yes your framework is definetly on my list. Memory is not that much of an issue with the X16 and it would be a good reason to look into banked memory 🙂.

Share this post


Link to post
Share on other sites

I updated to version 0.4 which now has basic sound support.

You can enable/disable by pressing the 's' key.

Next step is to implement some power up. I think I'll start with duplicating the ball.

  • Like 1

Share this post


Link to post
Share on other sites

So I managed to implement my first 3 power ups 🙂. Wasn't that hard. I also started some refactoring of the code. Looks already better now.

Now I have a basic sprite move/collision detection engine. The next power up will be a double laser cannon 😎.

I'm thinking about implementing Space Inavaders 
👾👾👾👾

🚀

  • Like 2

Share this post


Link to post
Share on other sites

Ok - so now version 0.6 is out. It features the mighty twin laser cannon 😎.

The game now can have up to 20 sprites at once on the screen. Looks like at least the emulator is totally fine handling this. If the hardware comes close to that I'm not worried implementing a "real" shoot'em up game some day!

Share this post


Link to post
Share on other sites
Posted (edited)
28 minutes ago, AndyMt said:

Ok - so now version 0.6 is out. It features the mighty twin laser cannon 😎.

The game now can have up to 20 sprites at once on the screen. Looks like at least the emulator is totally fine handling this. If the hardware comes close to that I'm not worried implementing a "real" shoot'em up game some day!

The emulator will allow up to 128 sprites at once, which is the same as the VERA will support. Also, like the VERA, the emulator caps out after trying to draw roughly 640 sprite pixels per line. My X16-Racer demo demonstrates this limitation, you can even see the effect in the screencap I posted.

Edited by StephenHorn
  • Like 1

Share this post


Link to post
Share on other sites

Well - 128 for sure is enough and to fill basically the entire screen with sprites isn't my goal ;-). 

I'm more concerned about my game logic, collision detection etc. I'm implementing with cc65 in C. I wasn't sure if the performance will be fine or if I have to optimize some code in assembler. Looks like this isn't necessary.

Share this post


Link to post
Share on other sites
On 7/3/2020 at 6:27 AM, Sandmage said:

I don't think Arkanoid did that, but I remember playing a clone in the MS-DOS days and I remember that paddle/ball interaction wasn't really physically plausible, but it was fun. By the way, we're in the same timezone. 🙂

The brick buster in my 3ds collection of knockoffs of old arcade games divides the paddle into five zones. The middle zone always bounces the ball straight up, the outer edges bounces it at a sharp angle right or left, and the mid zones do a mild angle right and left. So there is no computation of angles, it's just the impact point. Typically physically impossible but once you get the hang of it, it can be fun.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use