Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-19-2009, 08:16 PM   #26 (permalink)
Noobie here
 
Join Date: Mar 2009
Location: Fort Myers
Age: 17
Posts: 53
Default

Okay reading through my old posts I feel bad cause I was kinda rude/true noob.

But thats not what I wanted to ask. I created a new button called endButton and set it to be the button to start the game and end it. I did this because I set my buttons to have a different layout and the start and end buttons look bad. So my problem is when ever i swich the button from this:
Code:
[answerOne setTitle:@"Let's Play!" forState:UIControlStateNormal];
to:
Code:
[endButton setTitle:@"Let's Play!" forState:UIControlStateNormal];
and then hide answerOne the endButton does nothing. But when I unhide answerOne it still loads the quiz. What am I missing here? So it looks like this:

Code:
- (void)viewDidLoad {
    [super viewDidLoad];
	questionLive = NO;
	restartGame = NO;
	theQuestion.text = @"Welcome to the Quiz Game! Think you're a pretty smart cookie, huh? Well, let's test your knowledge!";
	theScore.text = @"Score:0";
	theLives.text = @"";
	questionNumber = 0;
	myScore = 0;
	myLives = 0;
	[endButton setTitle:@"Let's Play!" forState:UIControlStateNormal];
	[answerOne setHidden:YES];
	[answerTwo setHidden:YES];
	[answerThree setHidden:YES];
	[answerFour setHidden:YES];
	[self loadQuiz];
I've done all the connections and code i've needed to do that I know of. I hooked the button up in IB.

Last edited by RobertD63; 05-19-2009 at 08:23 PM.
RobertD63 is offline   Reply With Quote
Old 06-14-2009, 05:11 AM   #27 (permalink)
iPhone Developer
 
kohjingyu's Avatar
 
Join Date: May 2009
Location: Singapore
Posts: 326
Default

Quote:
Originally Posted by M of IMAK View Post
Once you have 'random() % numberOfQuestions', just multiply by 6 (in this case of a flat array) and index into the array. You should also randomize the position of each answer to mix things up.

I started out with random in 'That Ain't It! Trivia Game', but eventually moved to keeping track of which questions were displayed because using random was causing repeat questions more often than we liked.
What do you mean by index it into the array?
kohjingyu is offline   Reply With Quote
Old 06-17-2009, 02:15 AM   #28 (permalink)
AU Developer
iPhone Dev SDK Supporter
 
Join Date: Mar 2009
Location: Australia
Posts: 71
Default

Awesome Tute, thanks.

Will give this a crack when I get home.
__________________
Cheers,
Tristran

CodeBooster.org Founder - Supporting iPhone MMORPG's.
Swine Flu Test App - Make fun of the global over reation.
Tristran is offline   Reply With Quote
Old 06-19-2009, 12:36 AM   #29 (permalink)
iPhone Developer
 
kohjingyu's Avatar
 
Join Date: May 2009
Location: Singapore
Posts: 326
Default

Could the restart game function just be reloading the quiz?
kohjingyu is offline   Reply With Quote
Old 06-20-2009, 12:52 PM   #30 (permalink)
New Member
 
Join Date: Jun 2009
Posts: 1
Default

Hey can we put any color to UIButton as background? instead of a normal white UIButton, like a red UIButton and when we click, a yellow button is shown and so on...

Last edited by fail01; 06-20-2009 at 12:58 PM.
fail01 is offline   Reply With Quote
Old 06-21-2009, 05:00 PM   #31 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 31
Default

Using the code that AEDave supplied does anyone else's crash when trying to restart the quiz?

Thanks
daniel.steel is offline   Reply With Quote
Old 06-22-2009, 06:54 AM   #32 (permalink)
iPhone Developer
 
kohjingyu's Avatar
 
Join Date: May 2009
Location: Singapore
Posts: 326
Default

The restartGame function doesn't work.
kohjingyu is offline   Reply With Quote
Old 06-22-2009, 04:16 PM   #33 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 31
Default

Could this please be added?
daniel.steel is offline   Reply With Quote
Old 06-23-2009, 08:37 PM   #34 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by daniel.steel View Post
Could this please be added?
Yes, I am desperately in need of a restart function for this that also works for other apps. that is, pressing a button returns to the original view that was present when the game was first loaded.
chaseacton is offline   Reply With Quote
Old 07-08-2009, 12:00 AM   #35 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 15
Default

Quote:
Originally Posted by chaseacton View Post
Yes, I am desperately in need of a restart function for this that also works for other apps. that is, pressing a button returns to the original view that was present when the game was first loaded.
Anyone figure this out yet?
tofupunk is offline   Reply With Quote
Old 07-08-2009, 09:09 AM   #36 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by tofupunk View Post
Anyone figure this out yet?
I have an idea that would only take a little amount of time from a somewhat skilled programmer. You could just separate the game into 3 views including main menu (has start button), the actual game view, and then the final end view which has the restart button.

When you press start at the begging, it just stacks the view,

startView -----> gameView

when the game is over, it stacks the restart view.

gameView -----> endView

then, when its time to restart, you press the restart button and all the views are unstacked.

startView <----- gameView <----- endView



I would be able to do this if it was built in IB, but since its not, i need a more skilled programmer.

This could all be done inside one window with one view controller.
chaseacton is offline   Reply With Quote
Old 07-13-2009, 09:14 PM   #37 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 15
Default

There are two things I am trying to do with a quiz like this. 1, I would love to get the restart button working, but have been unsuccessful.
2, I would like to have multiple types of quizzes on the main view, with buttons leading to each quiz, but I have not had the best of luck with this either. Anyone else know how to best go about these?
tofupunk is offline   Reply With Quote
Old 07-13-2009, 09:54 PM   #38 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by tofupunk View Post
There are two things I am trying to do with a quiz like this. 1, I would love to get the restart button working, but have been unsuccessful.
2, I would like to have multiple types of quizzes on the main view, with buttons leading to each quiz, but I have not had the best of luck with this either. Anyone else know how to best go about these?
If you could do #2, then #1 would come easy. Unfortunately, too much of this was done programmatically for me to help/
chaseacton is offline   Reply With Quote
Old 07-22-2009, 12:20 PM   #39 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by chaseacton View Post
If you could do #2, then #1 would come easy. Unfortunately, too much of this was done programmatically for me to help/
Bump for a restart function.
chaseacton is offline   Reply With Quote
Old 08-01-2009, 05:49 AM   #40 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 40
Default

Thanks for the tutorial !!!
It's possible to have the question random and not always in the same order? For example i write in the txt file 100 quiz and each time i start the quizgame on my iphone it take 10 random quiz from the txt file.
Thanks
bonzer1 is offline   Reply With Quote
Old 08-30-2009, 04:04 PM   #41 (permalink)
Support Female Indie-Devs
 
sarahconnor's Avatar
 
Join Date: Apr 2009
Location: Austin
Posts: 197
Exclamation Reset Method

Did any one ever figure out how to reset the game???? I am sooo stuck!
__________________
Follow us on Twitter @mandylowry or @blackhivemedia
http://www.blackhivemedia.com/arcadejumper.html
sarahconnor is offline   Reply With Quote
Old 09-10-2009, 06:12 PM   #42 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 4
Angry Anybody???

Has anyone fixed this issue: checkAnswer method or fixed it so when you press Restart Quiz it actually works?

- (IBAction)buttonOne
{
if(questionNumber == 0){
// This means that we are at the startup-state
// We need to make the other buttons visible, and start the game.
[answerTwo setHidden:NO];
[answerThree setHidden:NO];
[answerFour setHidden:NO];
[self askQuestion];
}
else
{
NSInteger theAnswerValue = 1;
[self checkAnswerint)theAnswerValue];
if(restartGame==YES)
{
[self loadQuiz];
}
}
}
GeauxApple is offline   Reply With Quote
Old 09-10-2009, 06:13 PM   #43 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Nope, we're all still waiting. I think someone should redesign the game with IB to make it more editable and pretty
__________________
Freelance Inquiries:
www.chaseacton.com/services

Apps:
chaseacton is offline   Reply With Quote
Old 09-12-2009, 05:49 PM   #44 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: New Zealand
Posts: 189
Default cough cough

Maybe you?
LemonMeringue is offline   Reply With Quote
Old 09-12-2009, 05:50 PM   #45 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by LemonMeringue View Post
Maybe you?
I would if I had the time.
__________________
Freelance Inquiries:
www.chaseacton.com/services

Apps:
chaseacton is offline   Reply With Quote
Old 09-12-2009, 08:03 PM   #46 (permalink)
Registered Member
 
Join Date: Jun 2009
Location: New Zealand
Posts: 189
Default me too

some sleep would be nice
LemonMeringue is offline   Reply With Quote
Old 09-15-2009, 10:37 PM   #47 (permalink)
Support Female Indie-Devs
 
sarahconnor's Avatar
 
Join Date: Apr 2009
Location: Austin
Posts: 197
Question So Its set up in IB, just need someone to...

So attached is the file for the Quiz using IB, but i changed up the quiz a lil bit. The only thing it is missing is when you hit the restart button, it will not load again! If any one can figure this out, PLEASE let me know!!!!!

Thanks!

Mandy
__________________
Follow us on Twitter @mandylowry or @blackhivemedia
http://www.blackhivemedia.com/arcadejumper.html
sarahconnor is offline   Reply With Quote
Old 09-15-2009, 10:43 PM   #48 (permalink)
Support Female Indie-Devs
 
sarahconnor's Avatar
 
Join Date: Apr 2009
Location: Austin
Posts: 197
Question OOOPS!

So THIS TIME IT IS attached is the file for the Quiz using IB, but i changed up the quiz a lil bit. The only thing it is missing is when you hit the restart button, it will not load again! If any one can figure this out, PLEASE let me know!!!!!

Thanks!

Mandy
Attached Files
File Type: zip HowGreenQuiz.zip (28.7 KB, 404 views)
__________________
Follow us on Twitter @mandylowry or @blackhivemedia
http://www.blackhivemedia.com/arcadejumper.html
sarahconnor is offline   Reply With Quote
Old 09-15-2009, 10:48 PM   #49 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by sarahconnor View Post
So THIS TIME IT IS attached is the file for the Quiz using IB, but i changed up the quiz a lil bit. The only thing it is missing is when you hit the restart button, it will not load again! If any one can figure this out, PLEASE let me know!!!!!

Thanks!

Mandy
Well i could make a restart function as soon as you fix it because some of the button crash the app when pressed.
__________________
Freelance Inquiries:
www.chaseacton.com/services

Apps:
chaseacton is offline   Reply With Quote
Old 09-15-2009, 10:53 PM   #50 (permalink)
Support Female Indie-Devs
 
sarahconnor's Avatar
 
Join Date: Apr 2009
Location: Austin
Posts: 197
Exclamation

It seems like it crashes because of the data that is cached in the quiz view...
IN QUIZVIEW.M do this:
Code:
- (IBAction)buttonStart:(id)sender
{
	[self loadQuiz];
	//[self askQuestion];
}
Then once you get to the quiz, hit the yes button, then the quiz will start, and you can go thru all the motions, but once you try to restart, the quiz view is back to where you left off....See what I mean? Sorry! Im sure you can figure this out... I just cant

Thank you!!! Let me know if you have any findings!

Mandy!
__________________
Follow us on Twitter @mandylowry or @blackhivemedia
http://www.blackhivemedia.com/arcadejumper.html
sarahconnor is offline   Reply With Quote
Reply

Bookmarks

Tags
game, quiz, tutorial

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 267
19 members and 248 guests
2WeeksToGo, @sandris, AdamL, ADY, Dani77, diyora, F_Bryant, GHuebner, HDshot, headkaze, mer10, Oral B, prchn4christ, Rudy, smithdale87, Thompson22, timle8n1, Touchmint, vigu360
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,880
Threads: 89,228
Posts: 380,748
Top Poster: BrianSlick (7,129)
Welcome to our newest member, @sandris
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:56 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0