Freedom Fighter - Rise of humans *WORK IN PROGRESS*

Страница 3/22
1 | 2 | | 4 | 5 | 6 | 7 | 8

By thegeps

Paragon (1251)

Аватар пользователя thegeps

26-04-2019, 01:43

Bullet diagonal offset tables are 4 bytes long:
Left is
Db -8,-8,0,0
Right is:
Db -8,8,0,0.
Tables are aligned directly with an equ:
ramspttbl: equ 0ef00h
actpat: equ 0f000h

And sprites are:
0+1= airship sprites
2-3-4-5= clear scoreboard sprites (no changes)
6,7,8=player bullets
9-10-11=future 3 weapons (more bullets)
12-31= enemy sprites (ship+bullets)

Collisions works but sometimes some enemy sprites explode without meaning... And collision doesn't work near the left border, i tried it (and I'm sure of this case) just by putting 4 sprites (two colors, so 8 sprites) in the same line and I was able to shot only the third and the fourth. First two didn't explode. Tomorrow I'll record a video and put it here (now I'm in bed and using smartphone to read anf answer (I have a copy of the code in my SD card in the phone so I can do copy/paste from here too)

By santiontanon

Paragon (1831)

Аватар пользователя santiontanon

26-04-2019, 09:19

I haven't looked at the code in detail, but I see you are using unsigned comparisons (c/nc). So, in the left border, if by any chance a sprite is a pixel to the left of the border (coordinate -1), that will be read as a 255, and assumed to be on the right hand side of the screen. Maybe that's one of the problems?

By thegeps

Paragon (1251)

Аватар пользователя thegeps

26-04-2019, 10:01

Mmm. It can be, theorically. In fact if early bit clock is set the routine subtract 32 from enemy xpos before compare it to bullet xpos. But why it works with central bullet? And to test diagonal shots collision I've disabled all sprites except the 8 sprites in the same line. They don't move, and they haven't the ebc set (so no sub 32). But diag shot can reach only 3rd and 4th (5th,6th,7th and 8th sprites). Center bullet can collide with all of them. Now I'm at work, but this evening I'll record a video amd share it here.

By thegeps

Paragon (1251)

Аватар пользователя thegeps

26-04-2019, 19:32

I found it. Little, dirty bastard ebc... in diag sx shot! I checked the fire_button routine (I had an illumination) and it were there... when fire button is pressed the routine check for airship position and if necessary set ebc on diag sx (the only bullet that need it). So to fix the bug I've simply added :

	ld	l,31	;point to diag left shot color+ebc byte
	bit	7,(hl)	;check for ebc
	jp	z,shotcheck
	sub	32	;if so sub 32
shotcheck:
	cp	c	;compare l_shot xpos with left x of collision rectangle

By thegeps

Paragon (1251)

Аватар пользователя thegeps

26-04-2019, 20:05

And all seems to work! Well there are some sprites sometimes that won't disappear (color1 or color2 of the same sprite) but it's almost done. I don't know why these sprites won't diasappear. the routine checks ALL sprites for collision everytime. maybe when checking second sprite coordinates are already changed (it happens during ISR)

https://youtu.be/0R9D4XmgQVw

By santiontanon

Paragon (1831)

Аватар пользователя santiontanon

27-04-2019, 01:26

Very nice! Now that the engine is almost done, I am curious about what are you envisioning for the game. Number of levels, etc. or do you want to keep that secret for now? Smile

By thegeps

Paragon (1251)

Аватар пользователя thegeps

27-04-2019, 07:16

No secrets. I'm thinking about a "storyboard intro", some images of aliens invading the Earth and slaving humans. Levels will be:
1st on Earth
2nd space journey to the Moon
3rd Moon (where alens have a base)
4th space level through the wormhole aliens used to came to Earth
5th Alien Planet
All levels will have a boss (maybe two, it can be a midlevel boss too so I can load more tiles to change scenarios)
Probably a friend will draw graphics
Know norhing about sound fx and music (probably I'll search a tracker/player and study something to do)
Hints are welcome, od course!

By thegeps

Paragon (1251)

Аватар пользователя thegeps

27-04-2019, 07:18

And I have to study this bresenham thing for enemy bullets too -.-'

By wimpie3

Champion (438)

Аватар пользователя wimpie3

27-04-2019, 08:50

Shouldn't the enemies move faster when you speed up and slow down again when you brake?

By thegeps

Paragon (1251)

Аватар пользователя thegeps

27-04-2019, 09:23

Wimpie you are probably right, but it will be unplayable... Enemies' speed is constant in Zanac too (scrolling start slow and accelerate in that game too). And I added variable speed in the demo just to show what my code can do. I could or couldn't use it in final game Wink
As suggested time ago by Santiontanon I can use it during endlevel boss fight...

Страница 3/22
1 | 2 | | 4 | 5 | 6 | 7 | 8