Monday, July 25, 2011

Posting executable and source code

Hi everyone,

I abandoned this blog in January of this year, due to being too busy with school and roller derby to work on side projects like this one, but some comments have asked for source code to help them learn SFML. I usually learn a lot by looking at other examples and source code too, so I'll work on posting that, and the executable since the link i posted in my last post expired.

I did not finish this game either, unfortunately, but since revisiting this blog, I'm hoping to start another project, either picking up SFML again or learning a java game library. If anyone has any suggestions on a good java library to learn, leave a comment!

Saturday, November 20, 2010

Exectuable Ready

I can't believe how long it's been since I've posted. My crazy schedule finally caught up to me, and I felt like I was going to lose my mind a few times. Recently I found time to continue working on the game and finally got an executable ready to go! It's nowhere near perfect, the ship movement could use a lot of work, and animation and sound effects would be nice.

Thursday, November 4, 2010

Ship Movement Complete

Alright so I finished redesigning the ship movement. The up arrow works like an actual thruster would. When pressed, the ship starts moving that way. If the ship changes directions, activating the thruster again, the ship will slowly start moving in that direction. It was quite a challenge getting the ship moving like this.

For everything else I've done so far, I was able to think of the design in my head and implement the code. If it didn't work, I just had to make little changes. But for the ship movement, I felt completely lost. I actually made a text document to write out my ideas and analyze them after I wrote them out. This really helped me see flaws in my design (with the help of the debugger). I kinda felt rushed to start and finish this project, so I didn't do a lot of pre-planning. Now I regret not documenting my past ideas and not planning this out. I think it would have saved me a lot of time.

I also realize my code is very unorganized, so after I get the front-end looking OK, I'm going to fix the organization of the code. I also want to create text docs to explain what each class, function and variable are for.

Here's an updated to do list:
  • Have meteors break into smaller pieces, twice
  • Recreate meteors once all are destroyed
  • Get the "lives" displayed on the screen
  • Fix bullet - meteor detection
  • If time permits, add high score system
  • Create documents to explain code

Wednesday, November 3, 2010

I'm Back!

Its been a long week, and I haven't had a lot of time to work on this, so I'm so glad I actually accomplished something tonight. I decided the next thing to complete was the movement of the ship, which was trickier than I thought. I had to increase the acceleration of the ship when the thruster was activated, and then had to make it continue moving in that direction for a set time depending on how long the thruster was going for. I didn't finish all those things, but I did get the acceleration down, and it continues to move after the up key is released. So now when I press up, the ship starts moving. The longer I hold the up button, the faster the ship gets... and the ship never stops moving..... But now I'm getting a lot of vector errors =(. I'm going to complete the movement of the ship, then examine and fix the errors. Here's what the error looks like:


And a short term To-do list for ship movement:
  • Calculate a certain amount of time for ship to stop moving
  • Decrease acceleration as time goes on
  • Change ship direction change to not so sudden
I think I'm missing a few things but I'll discover them next time.

I had been feeling a little down whenever I thought about how much I hadn't gotten done this week. It made me feel like a failure. Maybe it was the push I needed to really sit down, clear my thoughts and think about what I had to do.

Tuesday, October 26, 2010

So close.. yet... so far....

I can't believe it's been almost a week since my last post! I've been busy with midterms this week, so sadly I haven't been able to work on this asteroid clone much. I've been able to do little stuff, like returning the game back to the game menu when it's over and adding a score system that works. Here's what it looks like now:

So this is theoretically after I destroy all the asteroids. For some reason the last image of the game blinks in-between the menu, not sure what's going on there. So it LOOKS like I'm almost done, but I actually have a lot to do still. One of them being the movement of the ship, which I just realized I have to redesign the whole movement method to get it moving right =(. I also watched a YouTube video of the real asteroids game, and the meteors are supposed to break into smaller pieces, then smaller pieces again. So......

To do before game is finished:
  • Redesign ship movement
  • Detect collision between ship and asteroid
  • Have meteors break into smaller pieces, twice
  • Recreate meteors once all are destroyed
  • Add a "Life" system
  • Fix bullet - meteor detection
And my goal is to finish all this by December 1st, 2010 :).


Tuesday, October 19, 2010

Font Problems

Alright so I haven't updated in a few days because I've been having trouble with displaying text with SFML. I ran into the common sf::String bug, so I tried loading a font to use from memory. That specific line always made my program crash =(. I searched through the forums and couldn't find a problem similar to mine, or so I thought. So I tried doing the other fix to the sf::String bug, which is to use static libraries. Since I had no clue what I was doing it obviously didn't fix it. While searching the forum though, many problems were linking the wrong libraries or not installing SFML correctly. So I went back and linked the Debug system library of SFML and it fixed the font problem! I even screamed when the program successfully ran without crashing


I know it looks like crap, but it's better than the blank white screen I've been seeing these past few days. This error took a lot longer than I expected, so I'm just going to make a small list of what needs to get done before this game is fully functional.
  • Finalize the start menu
  • End game after all meteors are destroyed
  • Add point system

Saturday, October 16, 2010

Fixed collision

So I was able to fix checking if the bullet collided with the meteor. The previous function worked in theory, but because the point positions were still "local" (relative to when it was first drawn, so the x's and y's of my points were all under 150, and my window is 800x600). In the function I transformed the points of the shape to global and it worked! Although the hit boxes could use a little tinkering, that's another thing I'm going to fix later. I also added an "outofbounds" function to the meteor class, but it's based on if the center of the meteor shape is out of bounds, so it's very specific, later I'll fix it to check the individual points of the shape.

As of now, this is what "works":
  • The ship can move, shoot bullets, and move from the very bottom of the screen to the top
  • When the bullets collide with the meteors, both disappear
  • When meteors move out of bounds, they appear on the other side of the screen
And here's what I need to work on:
  • Adding a Start Menu before the game starts
  • End game after all meteors are destroyed
  • Some sort of point system
  • Adding different levels after all asteroids get killed
After that's done here's what needs to be fixed/added:
  • Acceleration of the ship
  • Hit boxes of meteors
  • Out of bounds function of meteors
  • A high score board
  • "Blowing up" animation for the meteors
  • Varying speed for meteors
Oh and no picture today, everything looks the same as the last post.