Arcade Tennis (Electron)

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


Post Reply
User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Arcade Tennis (Electron)

Post by Dethmunk » Mon Jul 04, 2016 7:02 pm

Hi fellow Acorns. :) I'm a very amateur programmer on the Elk. I'm an artist by trade, so I can make stuff look nice, but coding I'm ok in the BASIC realm but the Assembler stuff, just never sinks in. :( Anyhoo. I've been doing a little Tennis game, sort of PONG crossed with a bit of normal Tennis. Its hopefully going to be a bit of fun and not too serious. Here's a few shots from the Emulator... I've had it running on my Elk too.

Image

Image

Image

Unfortunately, and you probably know what I'm about to say, the sprite printing in BASIC is ssssslllloooooowwwww. LOL. We all know this. I was wondering if anyone could steer me towards and a nice simple assembly code Sprite draw listing? A really simple thing like call Sprite, X, Y, Chr$ where X and Y will be the screen co-ordinates so I can just EOR it to the screen. I'm not looking to do a sophisticated game here, but it'd be great to get into doing some hobby coding. I know it won't be to the standard of the stuff I've seen on here for sure. :wink: Any help or pointers would be greatly appreciated.

Thanks Acorns... :D
Image

User avatar
roland
Posts: 2877
Joined: Thu Aug 29, 2013 8:29 pm
Location: Born (NL)
Contact:

Re: Arcade Tennis (Electron)

Post by roland » Mon Jul 04, 2016 7:31 pm

Just want to say that it looks nice =D>
256K + 6502 Inside
MAN WOMAN :shock:

User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Arcade Tennis (Electron)

Post by Dethmunk » Mon Jul 04, 2016 7:39 pm

LOL Thanks fella. The Art is easy, unfortunately. :wink:
May be I should do a Graphic Adventure next, that I could probably do quite well. Just drag the images off disk. :-)
Image

User avatar
leenew
Posts: 3569
Joined: Wed Jul 04, 2012 3:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Arcade Tennis (Electron)

Post by leenew » Mon Jul 04, 2016 7:45 pm

Cooool 8)

Tricky is the arcade game guru round here,
Maybe he can give you some good advice?....

Lee.

User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Arcade Tennis (Electron)

Post by Dethmunk » Mon Jul 04, 2016 7:53 pm

:D Awesome Thanks Leenew. I may have to pick his quite considerable brain on the matter. :)
Image

User avatar
jbnbeeb
Posts: 379
Joined: Sat Apr 03, 2010 8:16 pm
Contact:

Re: Arcade Tennis (Electron)

Post by jbnbeeb » Mon Jul 04, 2016 8:10 pm

Hey there! This looks great! There's a sister site - http://www.retrosoftware.co.uk where we develop homebrew games on Acorn machines. It'd be great if you did a post on there and tell us how you've got on with coding the game. IF you get stuck or have questions, there's some very clever and helpful peeps there too , including Tricky, our resident 50fps/crazy-number-of-sprites specialist :)
I'm going to ..
ABUG North Halifax June 10-12
Image

duikkie
Posts: 2830
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: Arcade Tennis (Electron)

Post by duikkie » Tue Jul 05, 2016 5:37 am

hope the game starts from &1900 and do not get lower then &1300 [-o< , although i am at letter A to convert all electron games.

maybe the game is 1 file only ? :D .

User avatar
paradroid90
Posts: 66
Joined: Sat Sep 21, 2013 4:55 pm
Location: Chatham Kent UK
Contact:

Re: Arcade Tennis (Electron)

Post by paradroid90 » Tue Jul 05, 2016 5:48 am

Looks great, and I am sure someone will help you on the coding side :-)
6502 Junkie :-)

User avatar
jms2
Posts: 1953
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: Arcade Tennis (Electron)

Post by jms2 » Tue Jul 05, 2016 6:10 am

Your graphics skills are incredible!, =D> =D>
Machine code sprite plotting will be essential though, as you say. As you only have three moving sprites, it might be best to avoid the sprite selection element and have three separate routines, eg to plot the ball you'd update the x ball and y ball memory locations and then do CALL ballplot. Same for the player sprites.

People will need to know how your sprites are stored.

Michael Brown
Posts: 1993
Joined: Sat Apr 03, 2010 12:54 pm
Location: Nottingham
Contact:

Re: Arcade Tennis (Electron)

Post by Michael Brown » Tue Jul 05, 2016 7:04 am

Excellent graphics.
Any chance of a BBC version as well when you add any machine code.

regards,
Mick.

duikkie
Posts: 2830
Joined: Fri Feb 07, 2014 3:28 pm
Contact:

Re: Arcade Tennis (Electron)

Post by duikkie » Tue Jul 05, 2016 7:14 am

it seems to be basic only for the moment. so if no poke and peek this will run on bbc :)
Michael Brown wrote:Excellent graphics.
Any chance of a BBC version as well when you add any machine code.

regards,
Mick.

User avatar
daveejhitchins
Posts: 4080
Joined: Wed Jun 13, 2012 5:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Arcade Tennis (Electron)

Post by daveejhitchins » Tue Jul 05, 2016 7:31 am

Another contender for the MGC - excellent work =D>

Dave H :D
Parts: UM6502CE, GAL22V10D, GAL16V8D, AS6C62256A, TC514400AZ, WD1772, R6522, TMS27C512, AT28C256
Products: ARA II, ABR, ATI, AP6, MGC, AP5 . . .
For a price list, contact me at: Retro Hardware AT dave ej hitchins DOT plus DOT com

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

Re: Arcade Tennis (Electron)

Post by sydney » Tue Jul 05, 2016 8:13 am

There are a couple of books that have a machine code sprite plotting routine that can bee called from basic. Creative assembler is one and I forget the name of the other but I'm pretty sure I own it. If I get time today I'll have a bit of a Google and post some links here.

User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Arcade Tennis (Electron)

Post by Dethmunk » Tue Jul 05, 2016 11:58 am

:shock: Wow so many posts :D
Thanks guys. Yeah jbnbeeb I've seen the Retrosoftware site. Good call. I'll have to sign up there too. :)
Duikkie - I have no idea what those addresses mean LOL. :lol: It's purely a BASIC game at the moment. I'm guessing it'll run perfectly on BBC B too. :wink:
JMS2 - Thanks man. Graphics are pretty easy, especially with the likes of Photoshop and Image2BBC :wink: The routines are exactly the way I was going to do it. Player and NPC/Player2 and the ball. I just need a fast way to blast it to the screen coordinates as EOR through BASIC (VDU5) is super slow. The Sprite is defined via 3 characters VDU23 one for each colour. Then printed to screen via VDU5 and GCOL 0,3 to give it the EOR effect. Its all very slow and plotting to the graphics cursor is always slow on the Electron. If its just a routine that takes the screen co-ords I give it and the chr$ number and just blats it to the screen then that would be all I need for now. :D
Sidney - Interesting I might have a look around the net for those.
Daveejhitchins - Whats MGC? :)
Duikkie & Michael Brown - Yeah I don't see why it wouldn't play on the BeeB. Might even revive the original Mode 2 graphics for that :wink:

Love it here, you're all super helpful guys/gals? :-)
Image

User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Arcade Tennis (Electron)

Post by Dethmunk » Tue Jul 05, 2016 12:09 pm

Daveejhitchins - MGC - I realise what it is... lol. Mega Game Cartridge. 8)
Image

User avatar
jms2
Posts: 1953
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: Arcade Tennis (Electron)

Post by jms2 » Tue Jul 05, 2016 7:28 pm

Dethmunk wrote:The Sprite is defined via 3 characters VDU23 one for each colour. Then printed to screen via VDU5 and GCOL 0,3 to give it the EOR effect.
Ah, I see. The player's sprite looks like two characters, one above the other - so am I right in thinking you are plotting six separate characters each time the sprite moves? If so, that's gonna be painfully slow!

It would be possible to make a custom machine code version of the VDU5/PRINT approach, but the closer you stick to the BASIC model the slower everything becomes, such that you might not get the speed improvement that you really need (given that the rest of the game is still in BASIC, and therefore slow). A more radical solution would be to store the complete set of bytes for each sprite (all three layers combined) in memory, along with the X and Y co-ordinates also in memory locations, and do a direct CALL to the plot routine to blit this to the screen without any need to pass parameters or specify characters etc. I'm pretty sure this would be the typical approach.

Another couple of things to think about are:

1) Where can the players and the ball move to on the screen? You may think this is a strange question, but if the X movement is constrained within certain limits it makes the routine easier/faster.
2) Do you need the sprites to move with pixel accuracy? I assume so, because that's why you're using VDU5, but its worth asking. In the X direction, 4-pixel increments are easier to do.

I'm not really a programmer so I don't think I can do this myself, but I hope someone else can because your sprites deserve it!

It's well worth defining the performance requirements of the routine in advance, because any limitations you place on it make a huge difference to speed. This is why the BASIC routines are so slow - they are complete generalised and 100% flexible. We need to get away from that as far as possible.

User avatar
jms2
Posts: 1953
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: Arcade Tennis (Electron)

Post by jms2 » Tue Jul 05, 2016 8:54 pm

sydney wrote:There are a couple of books that have a machine code sprite plotting routine that can bee called from basic. Creative assembler is one and I forget the name of the other but I'm pretty sure I own it. If I get time today I'll have a bit of a Google and post some links here.
I've just had a look at the one in Creative Assembler, and it would be OK except for one detail - it can only plot at whole-byte increments in the X direction. In Mode 5 this means 4-pixel accuracy, which might not be good enough. I can imagine it being difficult to get realistic ball angles if working to that constraint.

User avatar
Dethmunk
Posts: 178
Joined: Fri Jul 01, 2016 12:29 pm
Location: Guildford
Contact:

Re: Arcade Tennis (Electron)

Post by Dethmunk » Tue Jul 05, 2016 9:34 pm

JMS2 - You're right the system I'm using is way too slow. I should blit it to the screen as a full combined sprite. That would be the best solution. A 4 pixel X movement is not bad actually, as I probably want that 'speed' for the character to move, so the player feels like he's running around the screen. :D Accuracy, no is not essential, this is a very loose 'arcade' version of Tennis. More Pong than anything else. You win points by getting the ball past the player and out of the 'court'. Basically the players sole job is to return the ball. It should be fairly frantic, but if you strike the ball with a press of the key to swing the racket, just right, a super shot is activated (sort of a super shot, extra fast) :D
Another approach might be to slow the game down a bit and have different effects if you manage to hit the ball perfect. Imagine the something like the dropping trousers cheat in IK+ to distract the other player or freeze them for an instant. :lol:
Image

Post Reply