Monday, February 4, 2019

Collision Detection

I was confused why everytime I would detect collision between Bag Boy and the customer or car and the shoppimg cart but after reading that since they were all virtual sprites and technically copies of each other I had to do a different method of collision detection. With help from the AtariAge forums I made code that essentially creates a box around the sprites and when the x or y coordinates overlap in a given 8x8 pixel sprite area collision is detected. I also included a line that if pixels do not touch in this box than to ignore.

This method seemed to have worked. Now the cart doesn't seem to linger or hip around. I went ahead and programmed collision between Bag Boy and the car but did not make ant loss of life - I had a hard time utilizing life counters or life bars with this kernel and am not certain whether or not they would be compatible. If not I might be able to utilize a missile to serve this purpose. Unlike in the original Bag Boy!, where the car had a health bar, I have considered making the bar act as a timer for getting the cart to a customer in addition to the score. This may help provide difficulty and some other strategies.

But before I start on the life counters I want to work on car spawning. I have considered keeping a particular car for each lane, each with their own movement. For this I may add a global counter with each car reacting differently to it.

No comments:

Post a Comment

Manatee Madness!

Stage work is coming along nicely, with the foundations laid down for the Rain, Snow, and Volcano stage. The Black Friday stage is proving ...