Tuesday, May 18, 2010

Finishing up

ok, so i'm almost done, i've added in pictures of pipes, got some other things i wanted to do working, and i can reset the game after all the characters lives are gone. I have failed at flipping the direction my character faces, and I haven't flipped the character when he gets hit. The other thing i am still trying to do is to get a picture of an egg to represent a life, so there are three eggs, and when he loses a life, he loses an egg.

After i address some of those problems, I need to add in graphics for the floors, and then after that, maybe a few sounds if i can find them, then i'm done.

Monday, May 10, 2010

Killing Baddies

ok, so i've got my enemies working, and there's a bit of a glitch if they collide off the left side of the screen, but thats not too important.

So I thought of making the floor bounce up if my player hit it, and I worked on that, but had some trouble getting it to work, because sometimes my player hits the floor, and other times the block to prevent him from getting stuck in the floor. Anyways, I sort of got it working, but then decided that if i just made a new rect for my player that extends above the rect of the player so that when the player jumps, if he hits his head on either the roof or block, the extended rect will go through the floor and hit the enemy (if there is one). of course, this creates the problem of an enemy falling from above and hit my player from the top, but I think if I add a bit to my code, requiring the enemy to be on the floor to be affected by this new rect, I should avoid this problem.

Your idea to make the enemy jump when he is hit is a good idea, I hadn't thought of that. I do have it so that he jumps when he is hit after he is upside down, but then all my enemies fall through the floor (whether i hit them or not). Theres probably one line somewhere i need to fix. further more, once i hit my enemies from below, they don't stop moving even though i changed its xVel to 0.

The next thing to do is to get my enemies to get hit and die like i want them to, get my player to jump only one time (instead of when i press up even if he's in the air), and get my yoshi so that if he dies and then hits an enemy, he doesn't bounce again.

Monday, May 3, 2010

Enemies 2

okay, I've made enemies, they move at the speed i want them to, and fall at the same gravity rate as my player. I had to alter my floors slightly so that i could 1: get the enemies to reappear at the same x value on the opposite side of the screen if they went off, and 2: so the enemies would miss one of the floors and work like i wanted it to.

now that I have done that, i have created 2 sets of "def spawnNewEnemies():. One for enemies spawning on the left, and one for enemies on the right. (all I had to do for the enemies on the right was make their xVel negative of what it was).

The next goal is to create a collision detection between enemies so that if they collide, they both change directions, and then do it so that if my player hits the floor underneath the enemy, the enemy will "flip" (i'll just get it to change colour for now), and then get them to die if my player hits them, or get back up(change back to original colour) if my player doesn't touch them in time, and continue on its way.

Saturday, May 1, 2010

Enemies

So, I've finished fixing the problem that i had with the floors, and now I have moved onto making enemies. Later on, I will make enemies spawn at random (increasingly quicker), but for now I am just making an enemy in the top left corner of the screen and move to the right. I have created "gravity" for the enemy, but I am going to have to make it have a less downwards force so that it can make the gap between floors when it falls (as it won't be able to jump). After I have fixed that, i want to make it so that if the enemies x value is off the screen, it will appear on the opposite side (I will also do the same for my player).

response to comment

It shouldn't be a problem, because i have just created 3 classes: floor, wall block (so player doesn't go through side of 'floor'), and floor block (because the player would sometimes go through the 'floor'). All i have to do to create all 3 is add a couple lines into my main file.