Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

* * * * * 1 votes

Xcode Help | iPhone | Clock Game

c c++ clock

  • Please log in to reply
2 replies to this topic

#1 Meezer


    CC Lurker

  • Just Joined
  • Pip
  • 1 posts
  • Learning:C, Java, C++, Objective-C

Posted 30 October 2012 - 02:37 PM


My name is Alex and I would like to start off by saying recently I have been designing my own game in Xcode that involves a timer and the object of the game is to stop it on 1000. I have many more ideas that will make this app very addicting and less boring then it sounds but the problem is I'm stuck on a few things.

A couple of questions I have are...
  • Is there anyway to make it so when a player stops the clock on a number I have chosen the game will output "You Win" or something along those lines.
  • Is there anyway for it to randomly change the number once the player has successfully stopped it on 1000. Once the player stops the clock on 1000 I want the game to choose a random number between 100 and 10,000. But I would like it to be numbers like 300, 400, 500, 4,000, etc. I want it to randomly choose those kind of numbers so that way the game doesn't get boring.
  • Finally, is there a way to make a main menu in Xcode because I have so many ideas for this game and I would like to add different game modes.
I’m currently using Xcode 4.3.2 on a Mac 10.7.5. I know you are probably very busy but any help with this would be greatly appreciated.

Thank you,

  • 0

#2 Orjan


    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 31 October 2012 - 04:01 AM

2. There are at least two versions to do this. Either you allow all even hundreds in the game, then you just randomize from 1 to x (where x is your max value) and multiply that with 100.
If you want to choose a certain number of possible values, it's best to create an array with those numbers, and then randomize which position in the array that will be used.
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.

#3 BenW


    CC Devotee

  • Community Manager
  • 976 posts
  • Programming Language:ActionScript
  • Learning:ActionScript

Posted 31 October 2012 - 03:11 PM

Everything you asked about is possible, yes. If what you meant is that you're stuck on certain aspects of the coding, you need to be more specific - show us what you have so far, and what isn't working.

For example, for the first point, do you understand if conditions? Do you know how to make the timer count up? Do you know how to stop it when the player taps the screen? If you're only stuck on one of those points, tell us which one. If you can't do any of it, then you need to start with something more basic so that you understand what you're writing when you code.
  • 0



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download