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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.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 11-08-2011, 09:53 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 71
keyvisuals is on a distinguished road
Question Scoring in Turn Based Games

Hi, I've been following an excellent tutorial on Turn Based Gaming . . .
Beginning Turn Based Gaming with iOS 5 Part 2 | Ray Wenderlich

I'm able to handle scoring ok as long as there is only one match going on, but as soon as I start/join another match things go wrong.

For simplicity i've just been trying to add +1 to the players score every time they take a turn.

I've been using this to keep score for the current player:
Code:
self.currentScore = self.currentScore + 1;
currentScoreLabel.text = [NSString stringWithFormat: @"%ld", self.currentScore];
When I change to a different match the score for the previous match persists ;(

I'm sure my overly simplistic method of scoring is not ideal but that's why i'm following a tutorial Can someone show how to better handle this?
__________________
My #iPhoneDev Blog
keyvisuals is offline   Reply With Quote
Old 11-18-2011, 05:01 AM   #2 (permalink)
Registered Member
 
Naughty_Ottsel's Avatar
 
Join Date: Aug 2008
Location: Gillingham, Dorset, UK
Age: 19
Posts: 218
Naughty_Ottsel is on a distinguished road
Send a message via MSN to Naughty_Ottsel
Default

I imagine the best place to be is in your game set up code to reset the self.currentScore;
__________________
Follow me on Twitter
Naughty_Ottsel is offline   Reply With Quote
Old 11-18-2011, 12:49 PM   #3 (permalink)
Registered Member
 
fugufish's Avatar
 
Join Date: Nov 2011
Posts: 20
fugufish is on a distinguished road
Default

I'd recommend a reset too
__________________
About me
I experiment a lot with game analytics. Weapon of choice: Playtomic
fugufish is offline   Reply With Quote
Reply

Bookmarks

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: 380
10 members and 370 guests
apatsufas, comicool, Creativ, Dalia, dansparrow, LunarMoon, mer10, Murphy, pbart, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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