Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

project 3 method cohesion

+10 votes
My partner and I are having difficulty having our methods of processes such as timer, drawDragon, pointSystem & the game method fitting and running in unison. I'm mainly asking for some general logic on how the different pieces of the game fit together. I'm sure anything would help.

Thanks
asked Feb 1, 2016 in (Winter 15-16) by Kyle Doner 1 (100 points)

1 Answer

+4 votes
 
Best answer
In general, you want to have ONE main game loop.

If you have separate loops that do different things (e.g. moving the dragon in one loop, and moving the letter in another), you can't really run them in a way to get it to act like their both happening simultaneously.

So, instead, you just want ONE loop that does most things.  That doesn't mean you can't have helper methods (e.g. like the distance(...) method to compute distances between points, or like the drawDragon(...) method that does all the graphics necessary to draw the dragon once, in a specific location).
answered Feb 2, 2016 by Forrest Stonedahl (3,438 points)
selected Feb 8, 2016 by Kyle Doner 1
...