Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6099385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:16:02+00:00 2026-05-23T13:16:02+00:00

I have 10 Levels. Just like a normal game, you can’t play the next

  • 0

I have 10 Levels. Just like a normal game, you can’t play the next level unless you beat the level before it. The only parts that change on each level is, one sprite and the sprite’s position.

How could I make it so if you beat the level the next level unlocks, then distinguishes which level you are on and loads the defined “details”(meaning sprite file and position)?

Any help is great appreciated! Thanks!

EDIT:

I used a plist to load all the information regarding the level

First, I created the PLIST(right click a group then, click resources, “Property List”). Next, I defined all information within the PLIST.

Then, I set up a global variable to set the level number. When the user chooses whichever level(which is a CCMenu), the method changes the int “level” to the correct level number(e.g. 1,2,3,4,5). Then, in my game init it checks the int “levels” and runs the level from the PLIST.

This is in my level methods that the gamescene init runs after the level check. It loads the PLIST, sets the dictionary, chooses the background, adds it to the layer, then the ints “_ballX, _ballY” are declared in the .h file which sets the value for the ball’s position located in the init!

NSString *path = [[NSBundle mainBundle] bundlePath];
NSString *finalPath = [path stringByAppendingPathComponent:@"Levels.plist"];
NSDictionary *plistDataAll = [[NSDictionary dictionaryWithContentsOfFile:finalPath] retain];
NSDictionary *levelData = [NSDictionary dictionaryWithDictionary:[plistDataAll valueForKey:@"LevelOne"]];

NSString *background = [levelData objectForKey:@"LevelBackground"];

_m = [CCSprite spriteWithFile:background];
_m.anchorPoint = ccp(0, 0);
_m.position = ccp(0, 0);

[self addChild:_m];

_ballX = [[levelData valueForKey:@"BallPositionX"] intValue];
_ballY = [[levelData valueForKey:@"BallPositionY"] intValue];

Hope this helps someone! Thank you to everyone for the very quick responses!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:16:02+00:00Added an answer on May 23, 2026 at 1:16 pm

    Have your level class load the data for the level from some data file (a plist file, or xml, or whatever). Then whenever you want to load a different level just point to a different data file.

    As for unlocking levels, simply make an array of levels along with their locked/unlocked status that the level select class uses to display the different levels. Between games that information can be stored in another data file (again, a plist file, or xml, or even using CoreData).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just noticed something strange. If I have this XML: <level number=7 background=background_5> and
I have a huge checkbox list with different levels and I would like to
I have developed a ios game with 20 levels. I have menu at starting
just want to verify that database partition is implemented only at the database level,
I have a recursively nested schema just like comments work on a blog. What
I have multiple levels of the following: IF EXISTS(...) BEGIN IF NOT EXISTS(...) BEGIN
First, is it possible to have n transactions levels over ADO.Net. Second, is this
I'm trying to accomplish a simple thing. I have a 2 levels menu with
I have few questions about ssis transction isolation levels. consider a scenario:I have an
I have an app with 2 user levels; Superuser, and Staff. Superuser will login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.