Saturday, March 9, 2019

Fixed Car Spawning Again!

I haven't checked the cycle issue on hardware yet but in my search for a fix I discovered why my car spawning was off on a couple of the cars.

For power ups I utilize virtual Sprite player7 for all of the power ups since only one is on the screen at a time so I have a variable pick which Sprite will he player7. Before I did that I used several virtual sprites, each associated with a power-up.

When I had made the change to player7 I had forgotten to delete the redraw for a couple sprites so when I wrote the code using those virtual sprites for something else, when I ran the program it would seemingly redraw the placement of the cars in the course of the power up generation. I finally erased this code and now the car movement works fine.

I will update the movement of the cars for increased difficulty soon, especially since I freed up some space. 

Friday, March 8, 2019

Fixed Over Cycles?

This issue has boggled my mind for the last week and I have been stumped at every turn.  I had decided to consolidate some redundant code and move things around to make things more efficient.  Since actions like Bag Boy touching the various car sprites have the same result I moved all like code together and had each collision jump to the same spot and share the same code.  When I ran a test everything seemed to work but I also noticed the game didn't run over in cycles.

I entered "breakif {_scan>#262}" in the Stella debugger as well as monitor the cycle count on the top left of the screen in real time and didn't experience any overages. I am not sure if I had actually fixed the issue but it seems to have gone away. I will test on hardware soon but in the meantime I will continue to clean up code in Bank 2. This will give me space to add a couple things in the future if necessary. My changes on the player/car collision freed up 200 bytes so I am sure there are more opportunities to make space. 

Thursday, March 7, 2019

Screen Rolling

I had recently acquired a Harmony Cart and when I played my game on actual hardware it was amazing. Gameplay using an actual joystick added a whole new challenge but then something happened - the screen started rolling.

After some pointers on AtariAge I discovered my scanlines would go to 263 for a brief moment that was seemingly unnoticeable in emulation without proper viewing. After watching the scanline count it seemed random but tere was another odd situation. The top car would disappear after a bit and never return.

The only thing in common with the rain playfield and the car were they were both activated by an if/then statement tied to the score. I had deleted the whole car code and seemed to not experience a scanlines increase but my laptop battery was dying so testing will continue tomorrow.

Another thing I had an issue with was the rain. I tried using my code from before but it didn't work the same. I figured it was probably due to the fact that I am using the DPC+ kernel so the pixels are smaller and with multiple sprites and colors it was not as simple as before. The sprites appeared farther apart. To solve this I instead used a virtual sprite. It still didn't work the way I wanted but it kind of looked like lightning so I was thinking in the rain stage the lightning will come from the top of the screen and head toward the cart. You have to get the cart to the customer ASAP or risk getting fried. I may put in an option for the joy0fire button to release the cart to avoid shocking Bag Boy.

Depending on all this testing and what I want done with gameplay,  I may move the difficulty back to a separate bank to provide more gameplay code in bank 2, like player 2 control.

Tuesday, February 26, 2019

Game Play Test!

Game play test with cars, power ups, customers, and progressive difficulty. Needs tweaking but it is getting there!




I had also modified bottom-most x-coordinate for position, adjusted collision between lot customer and cart towards the bottom of the screen for playability, and modified the code for car movement.


Will be adding a second player option soon. The second joystick will operate the customer and cart, where the second player can alternate between the two with the press of the button.  I may have to work out some gameplay details so that the second player just torpedo the cart into the bottom cart every time.

Thursday, February 21, 2019

Power-Ups!

Finally!

I got the power-ups not only spawning but also disappearing when either touched by Bag Boy or on their own after a short duration!

Still working out the details but this will definitely speed things along... sort of.

Still gotta work out things like color, sound, effect, etc. but getting their existence right is a start and an important step.

I also shrunk them down for a couple reasons.  The first is because my wife wanted smaller power-ups because they were bigger than the car.  The second reason is to reduce flicker.  Once I tighten the spawning I will try to minimize overlapping of y-coordinates.




Power-Ups Almost Fixed!

I have almost solved the lingering power-up problem. Previously the power-up would spawn and when Bag Boy would collide with it it would stay. I had finally realized that with each loop I had a variable continually adding up. So at a particular value the variable would go to the generation subroutine but that variable would continue adding which seemed to negate the collision. To solve this I placed an if then line before the variable value that checked to see if it was the generation value. If yes it skipped the generation code and go to the collision detection. Then, once collision is detected it resets the value.

Once the bugs are worked out I will give each power up a specific ability and hammer out the randomization code to make it balanced. 

Saturday, February 16, 2019

Power Ups!


Originally I had the power up generator code initiate every time the timer hit a certain number.  This worked great but collision detection never worked.  After wracking my brain I recall that sometimes when the score goes below a certain number the cars added for difficulty stop moving and collision detection ceased to work in those instances as well.

So instead of tying power up generation to the timer I tied it to the score, with it initiating at greater than or equal to zero.  Then in the bank where the code was, I created another variable to mirror the timer variable.  Now the power ups generate as they should but with one small problem - I am having a problem getting rid of them promptly.

For instance, the energy drink appears. If the player sits over the drink at the time it eventually disappears they get the benefit (for testing purposes this is just 500 points).  I assume this has something to do with the timing.  I will investigate this further at a later time
 

Bugs fixed!

With some help on the AtariAge forums, it was pointed out that an error in my code was causing the screen to jump. It also came to my attention that the game was not capable of running on hardware, possibly due to the formatting of comments.

So with those changes implemented I had moved onto power-ups.

I had decided to place them in a separate bank and after trial and error think I had gotten their appearance and disappearance to work well.

Using the timer variable, I have the power-ups checked at one point each cycle. At that point anotger variable is randomized. It has the chance of becoming a few things:


  • A watch - that provides more time on the timer. 
  • An energy drink - that will allow for increased speed. 
  • Money - increased score. 
  • 1up - an extra life. 

There is also a slight possibility no power-up is picked. When the variable corresponds to one the others are pushed off screen. The variable then continues to increase. Once it reaches a certain point it disappears.

The timer then goes through it's next cycle and performs it's check again. Depending on how tings work, there may be greater chance for no power-up.

I may also add another power-up  - an umbrella.

I hope to add a couple more things for progressive difficulty, with the big thing being rain. I think I can implement this by randomising the ball Sprite for the appearance of rain and modifying movement. I was thinking an umbrella could be used to minimize movement issues.

Obviously I would be utilizing more than 9 virtual sprites so I plan on having player9 switch what it is depending on the situation.

I have also not determined the color and size of the power-ups. Part of me want each Sprite to have it's own colors while I also want ten to flash. I also don't know if they should appear as large as the player0 sprite or if I should make them smaller to minimize flickering. 

Thursday, February 14, 2019

Status Bar!



I got the status bar and life counters working thanks to some help from the AtariAge forums.  While the mini kernel would not work, Tony the 2600 pointed me in the right direction with some sample code he had used to implement simple bar and counters, which is perfect since it fills the graphic void on the bottom of the screen and provides me with a stepping stone to continue gameplay elements.

Now that the life counters are implemented, I will work on making them decrease when a collision is detected between Bag Boy and a car.  I may also have a loss of life when the counter runs down.

As for the counter, I plan on having it slowly decrease until you get the cart to the customer, when the counter will be replenished.  Customer #2 and collisions between the cart and the cars will also cause incremental decreases.

Because of this gameplay elements I will have added random power-ups - a 1UP and a clock for more time.  The only other power up I was considering at the moment was an energy drink that when consumed speeds up Bag Boy's movement.  I may also have a double energy drink that can speed him up and freeze the clock but that has yet to be determined. 

Wednesday, February 13, 2019

Progress on Difficulty

I freed up some variables in the movement section being that Bag Boy's X and Y movement are the same value. I then used those variables for the additional cars so that I may link their movement to a separate one as difficulty progresses. I will next try and determine how to best adjust values as score progresses to make it more difficult.

Once I have the mechanics figured out I will work on a power up or two,  like an energy drink that allows for faster movement when the button is pressed but I do not want to implement that until I can figure out a status bar because I will undoubtedly want some kind of timed element to keep the game moving.

I had also did some minor housekeeping and improved on the playfield graphics. 

Saturday, February 9, 2019

Virtual sprite reflection.

Was playing around with audio and title screens. I couldn't seem to get either to work so I decided to play around with some little things like reflection of the virtual sprites so now te second customer flips direction and no longer moonwalks and the shopping cart faces the car it follows.

I still have some work on cart direction when captured by Bag Boy but it is slightly better.

I was also trying to set up life counters or status bars but don't think I am able to get it to work with this kernel so I was considering creating a separate screen (like the game over screen in my original game). 

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 ...