New 1K hires game in progress: Artillery Duel

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
1024MAK
Posts: 5165
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: New 1K hires game in progress: Artillery Duel

Post by 1024MAK »

Hey, sounds like you are making good progress :D.

Keep up the good work ;)

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer being good this year.
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

1024MAK wrote:Hey, sounds like you are making good progress :D.

Keep up the good work ;)

Mark
Not enough yet.

Need more shrinking
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Input routine altered.
Now only 1 change of entering the values for angle and speed by keyboard but with test on valid values only.
No longer setting with + / - and ready when NEWLINE pressed.

I managed to release 32 bytes.

Furthermore the table from claypigeonshoot (sinus) will become base for display, but with altered dx-routine.
Although not exactly a Bresenhamdisplay it will do well enough for correct gameplay.
Since the distance between points on the table is relative short the error from Bresenham is repaired 30 times through the table.
(complex, I thought so!)
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

And reading the SINUS-table in reverse order makes it a COSINUS.
With both I can recalculate the speed of the ball out of the cannon into horizontal and vertical speed.
and use the sinus table as the looping of the cannonball by gravity.
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Getting somewhere.

Tables set and speedcalculation
Routine for 'following' a line in just 27 bytes

Only to do add this routine, do entire loop
check on hit.

Bytes left: 62-27=35 bytes
I moved temporary screen to filler memory and that made me shift entire screen 24 bytes.

Also still possible save of 20 bytes when rock is 1 byte smaller.

Almost....
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Function for dy and dx derived from speed out of cannon working.
I missed a few tablevalues.
Some routines copied over sysvar above from tables copied over sysvar.
So now still 56 bytes free - 27 for movement.

To add in 29: continue to next step in movement according to SINUS table and check on hit.

promising.....
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

61 bytes left, some pairloading altered in just loading the lowbyte and a shifting routine altered to use preset values better.
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Basic movement added.
Next to do is following the sinusloop.
Cannon is moving on the screen.

I even shortened the routine from 27 to 26, a dx movement is always needed so testing reached coordinates could be done later.

Still 33 bytes free and possible 20 in altered display.
Almost....
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Loaded cannon was shown and fired after input from angle and speed.

Now shown before input, indicating who's turn it is.

Just a few things to do, set correct start, read next value in shooting loop, test out of screen, test hit restart game.
All can be done in max 10 bytes, I think.

28 bytes left (and still option on 20 bytes in altered screen).
dr beep
Posts: 2178
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: New 1K hires game in progress: Artillery Duel

Post by dr beep »

Finetuning the last steps.

Shot left and right working, but calculation of Y-height is a problem to figure out.
It will be a small adjustment, will find it out.
Memory left: 0 bytes!!!!!
Post Reply