For some reason when I try to embed my sketch on here in the Html section of my post it doesn’t show up on the blog and it get’s erased so if you want to see my code go to:
For my Final Project I wanted to make a simple racing game. I wanted a red car that the player controls while avoiding on coming traffic. The player keeps playing until he/she collides with another car. I did do most of what I wanted to create. A car that moves with the arrow keys, a road, roadmarks that repeat, on coming traffic that repeats, and when a collision happens both cars stop moving and it’s game over. On Tuesday after class I ending up saving over my final with a broken code so I had to start over, luckily I had another draft so that I wouldn’t start over from scratch. But since I did start over, I didn’t have the time to add a score system which I did have ,a reset feature, and the blue square was suppose to also collide with the red car and contain an image(it was my bike class). Something that I wanted to do was have the oncoming traffic move down the screen at random x locations, different cars, and random speed. Other than the starting over the problems I came across were the collision testing (setting up the xpos+wid > truck.xpos, that type of stuff), because I just couldn’t wrap my head around it for a while. I also couldn’t figure out how to stop the objects from moving after the collision. I had a lightbulb moment and felt really dumb afterwards when I realized all I had to do was multiply the speed variable by 0. Then I got stuck trying to make a vehicle class to use as an array for my different cars to move down the screen at different locations and speeds and then time just ran out.