• entries
654
2,663
• views
891,991

# playfield collisions and more

699 views

Playfield collision logic is now in place. When moving the humanoid the score will change from white to red. When moving Otto the score will change from green to blue.

Humanoid not touching the wall

Humanoid touching the wall

Otto not touching the wall

Otto touching the wall

As you might have noticed, the robots can now appear in different colors. The current colors are just tests, so let me know if you really like or dislike any of the combinations. The color works by having a single color table entry for each robot shape along with 3 color tables(Main, Accent, Eye). When the robot's color entry is processed any 0 entry becomes the Eye color, 1 entry becomes Dark Grey (used for the Tank, replaced with color value of 4), while all other entries are used as the LUMA portion of the color with bit 0 being used to select if it's the MAIN or the ACCENT color.

```RobotStationaryColor:	; max of 10 so we can have dark/light robots
.byte 8		; 1
.byte 0		; 2 eye
.byte 6		; 3
.byte 10	; 4
.byte 10	; 5
.byte 8 + 1	; 6 accent
.byte 4 	; 7
.byte 4		; 8
.byte 6 + 1	; 9 accent
.byte 4		;10
.byte 4		;11
.byte 8		;12
.byte 10	;13

TankStationaryColor:
.byte 4		;  1
.byte 8		;  2
.byte 8 + 1	;  3 - accent
.byte 1		;  4 - grey (replaced w/4)
.byte 1		;  5 - grey
.byte 1		;  6 - grey
.byte 1		;  7 - grey
.byte 1		;  8 - grey
.byte 0		;  9 - eye
.byte 8 + 1	; 10 - accent
.byte 8 + 1	; 11 - accent
.byte 4		; 12
.byte 8		; 13
.byte 10	; 14```

The luma is limited to a max of 10 so that we can have Dark, Normal and Light variations of each color. 2 is added to the luma for Normal while 4 is added for Light.

```CYAN		= \$B0
YELLOW		= \$10
WHITE		= \$0F
RED		= \$40
GREEN		= \$C0
BLUE		= \$90
PURPLE		= \$60
GREY		= \$00

; used to adjust the robot color table
DARK	= 0
NORMAL	= 2
LIGHT	= 4

MainColors:	; denoted by 0 in bit 0 of robot color
.byte NORMAL	+ CYAN		; 0
.byte DARK	+ GREEN		; 1
.byte LIGHT	+ PURPLE	; 2
.byte NORMAL	+ YELLOW	; 3
.byte DARK	+ RED		; 4
.byte LIGHT	+ BLUE 		; 5
.byte NORMAL	+ GREY		; 6
.byte DARK	+ CYAN		; 7
.byte LIGHT	+ GREEN		; 8
.byte NORMAL	+ PURPLE	; 9
.byte DARK	+ YELLOW	; 10
.byte LIGHT	+ RED		; 11
.byte NORMAL	+ GREEN		; 12
.byte DARK	+ PURPLE	; 13
.byte LIGHT	+ BLUE		; 14
.byte LIGHT	+ GREY		; 15

AccentColors:	; denoted by 1 in bit 1 of robot color
.byte NORMAL	+ YELLOW	; 3
.byte DARK	+ RED		; 4
.byte LIGHT	+ BLUE 		; 5
.byte NORMAL	+ GREY		; 6
.byte DARK	+ CYAN		; 7
.byte LIGHT	+ GREEN		; 8
.byte NORMAL	+ PURPLE	; 9
.byte DARK	+ YELLOW	; 10
.byte LIGHT	+ RED		; 11
.byte NORMAL	+ GREEN		; 12
.byte DARK	+ PURPLE	; 13
.byte LIGHT	+ BLUE		; 14
.byte NORMAL	+ GREY		; 15
.byte DARK	+ CYAN		; 0
.byte LIGHT	+ GREEN		; 1
.byte LIGHT	+ PURPLE	; 2
EyeColors:	; denoted by a 0 in the robot color list
.byte 8	+ BLUE		; 0
.byte 8	+ GREY		; 1
.byte 8	+ CYAN		; 2
.byte 8	+ GREEN		; 3
.byte 8	+ PURPLE	; 4
.byte 8	+ YELLOW	; 5
.byte 8	+ RED		; 6
.byte 8	+ BLUE 		; 7
.byte 8	+ GREY		; 8
.byte 8	+ CYAN		; 9
.byte 8	+ GREEN		; 10
.byte 8	+ PURPLE	; 11
.byte 8	+ YELLOW	; 12
.byte 8	+ RED		; 13
.byte 8	+ CYAN		; 14
.byte 8	+ GREEN		; 15```

You might have also noticed that the shots have shrunk in size.

ROM

Source

There are no comments to display.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.