Making an integer not reset after game over

Posts: 1
Joined: 2015.02
Post: #1
I feel like this should be really simple but I cant find a tutorial to explain it and unfortunately I'm not experienced enough to solve it myself and basically rely on tutorials to learn.

I have a game and if you jump over an object you get a point. Please try to imagine with me if you will, I have set it up so there are two numbers on the screen. One number is in the top right and the other in the top left. As of right now, both numbers get +1 when the player jumps over an object, which is what I want. The problem is, both numbers are reset when the player loses. I want the value in the top left to not reset, and keep being added on to with each point the player gets.

If someone could help me with a simple solution for this I'd be very grateful!!!

Also, I should mention I'm using Swift and Spritekit
Quote this message in a reply
⌘-R in Chief
Posts: 1,277
Joined: 2002.05
Post: #2
Well… just don't set it to 0... Somewhere you have code that's setting it, so just don't do it.

It's not possible to give you any more specific advice than that without seeing code.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Making dungeon/rpg styled game, looking for some input! Tosty 0 1,931 Oct 18, 2014 06:42 AM
Last Post: Tosty
  Problem with making a game with the iPhone Game Development book MrPenguin9 2 7,124 Feb 1, 2010 09:13 AM
Last Post: MrPenguin9
  Define Random Integer (Best Way) 9livesoftware 2 4,598 Sep 24, 2009 11:09 PM
Last Post: Bachus
  How to display integer? lightlab 5 4,964 May 3, 2009 01:48 PM
Last Post: Nosredna