Today I was mostly working on getting the shopping cart up and running, but I also worked a little bit on the garbage generation system. While I was doing a test run I noticed that I was sometimes getting ten or more bad garbage in a row. I found this became frustrating and boring very quickly so I knew I had to make it so that a good garbage would drop every few bad garbage, making sure there was always a goal on screen for the player to work towards. I had to partly rebuild my garbage generation system but it's defiantly for the better now. I was using a while loop to try and generate a piece of garbage, if the garbage selected was too expensive then it tried again. One problem with this was that only the good garbage had a chance of being rejected since the bad garbage doesn't take away from the remaining points for the current level. I fixed this issue by moving the while loop to inside the good garbage generation inside the general garbage generation function. This way if the good garbage was too expensive it would try for another good garbage instead of possibley spawning a bad garbage instead. I also put in a counter that, after four bad garbage have spawn makes it so it automatically spawns a good garbage next, just in case the random numbers keep coming back bad garbage.
For the shopping cart I have it so if your at the front and it hit, the cart bouncing back some and your rubbish is pushed the other way for a second. It also takes away one health when it hits. I get around having to make giant leaps over the whole cart I added in that if you land on the top of the cart it bounces you up to near the top of the screen, you can't jump any more after that but you can fall quickly if the down arrow is pressed. In the video that's posted the bouncing off the top of the cart hadn't been added yet.
The last thing I add is that once a jump is started you can only travel in one direction. After coding it though I didn't think it was as fun to jump around so I've commented it out for the time being, however I might change my mind after I've tweaked with the jumping some more.
This blog reflects my progress that I make on different projects as I work my way though them :D Wish me luck
Showing posts with label problem. Show all posts
Showing posts with label problem. Show all posts
Thursday, 6 September 2012
Carts hurt
Wednesday, 5 September 2012
Isn't Jumping Fun??
Today I worked some on the gravity levels, max fall speed and base jump power for the rubbish, I was finding that you couldn't jump high enough, and then you seemed to just float down. So after some tweaking I was able to find a level where there is still lots of room for upgrading your jump power but you still are able to go quite a lot higher. I also added in the functionality to the down button which allows the rubbish to descend rapidly from the air, faster then the max fall speed would normally allow, in case they need to hit a rat or grab a garbage that's below them. I think that I'm going to make an upgrade that allows you to do this instead of allowing the rubbish to do it from the start of the game.
I also added in a very basic cart which only appears after level 7. So far all it does is spawn on the right side, roll across the screen then kill itself once it's off the left side of the screen, however I plan on making it so if your rubbish gets hit by the side of the cart they take 1-2 damage. I was also thinking of allowing the player to bounce off the top of the cart if they are currently falling, this would add more strategy to the game along with extending the amount of time a player can stay up in the air, however they wouldn't get their jumps back.
I also added in a very basic cart which only appears after level 7. So far all it does is spawn on the right side, roll across the screen then kill itself once it's off the left side of the screen, however I plan on making it so if your rubbish gets hit by the side of the cart they take 1-2 damage. I was also thinking of allowing the player to bounce off the top of the cart if they are currently falling, this would add more strategy to the game along with extending the amount of time a player can stay up in the air, however they wouldn't get their jumps back.
Subscribe to:
Posts (Atom)
