So, I finished a pong game and upped the ante to a clone of the game Snake. Now I want the "food" to spawn at a random Vector 2 every 3 or so seconds (I'll flesh out the mechanics later). I've got two food classes, one for "good food" and one for "bad food." The random positioning works adequately, but I'm unsure how to draw more than one. I'm thinking something along the lines of (psuedo code):
if (counter <= 3)
n = rand.next (0, 100);
if (n <= 75)
counter = 0;
My food classes each have their own draw method that I call in the game1 class draw method to keep things from getting cluttered, so the draw would look like:
foreach (Food food in goodFoodList)
Am I on the right track? Is there anything I need to include in the food classes to get this working properly? Is there a better way of doing things?
Thanks in advance for the help. I really appreciate it.
wtfmatesMember Since 24 Oct 2012
Offline Last Active Nov 27 2012 09:01 AM