The Daily Click ::. Forums ::. Klik Coding Help ::. New Super Mario Bros - Star Coins
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
20th June, 2013 at 20/06/2013 19:47:06 -

I don't think I'm actually going to implement this feature as I'm guessing it could get a bit messy, but say you have 20 levels, each with 2 hidden coins, is it difficult to keep a record of which coins you have collected from which levels?

Just curious! Thanks for any insight.

 
Image

Tell 'em Babs is 'ere...

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
21st June, 2013 at 21/06/2013 01:48:45 -

I would use an ini file for this to be honest. You can obviously encrypt it if you need to but an ini would more than likely be the easiest solution.

[level number]
star1=0 or 1
star2=0 or 1

unless anyone has any other ideas???

 
n/a

Superslimeboy

President of Space

Registered
  24/12/2012 09:15:07
Points
  55
21st June, 2013 at 21/06/2013 03:47:39 -

you could probably do it with a bunch of global values

 
I forgive you, Wheatly.

nim



Registered
  17/05/2002
Points
  7233
21st June, 2013 at 21/06/2013 07:07:06 -

Yeah, do what Lembi suggested. It'll be pretty easy and also be a good introduction to working with inis if you've never used them before.

 
//

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
21st June, 2013 at 21/06/2013 22:39:08 -

Thanks guys.

I used an ini once, about 10 years ago to save a characters position in TGF... Those were the days. No idea how I did it now though! Would I have to use one ini to save the coins data, then another ini to save what level the player reached so they can resume next time? Or can all this be handled using just one ini?

 
Image

Tell 'em Babs is 'ere...

nim



Registered
  17/05/2002
Points
  7233
21st June, 2013 at 21/06/2013 23:14:52 -

You can use the same ini for both.

Remember that you can open the ini file in notepad to see the data, if that helps.

 
//

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
21st June, 2013 at 21/06/2013 23:36:56 -

Thanks nim, that'll be useful!

The plan was to build every level first, then start figuring out ini's right at the end as that's pretty much the only essential thing left that I need to sort out. Is it better to start using it now though? I guess I'd have to copy the object/code into each frame later?

 
Image

Tell 'em Babs is 'ere...

nim



Registered
  17/05/2002
Points
  7233
22nd June, 2013 at 22/06/2013 23:49:53 -

It's always better to get the engine finalised before duplicating the frames, but yeah, you can add it later too. It won't be a lot of code. Just as long as you're OK with doing the old MMF copy & paste dance right at the end.

 
//

nim



Registered
  17/05/2002
Points
  7233
22nd June, 2013 at 22/06/2013 23:58:46 -

Just something I thought about:

There'll be little bit of thinking involved when you get to the part where you have to relate "coin1" in the ini to the correct coin (out of 3) in the level.

If you're always going to have 3 secret coins (no more, no less) the easiest solution would be to create 3 separate coin active objects ("secret coin 1", etc) and refer to them directly in the events. You can also use Spread Value A blah blah but it's a little complicated. It will mean having 2 extra objects and a few duplicated events but it's not a huge additional overhead. It's up to you, but if you're going to do it this way you could create the 3 separate coin active objects in advance before you duplicate the frame to save some time.

I'm sure there are a bunch of ini tutorials here in the Articles section, or just give me a shout on Twitter if you have trouble with it and I'll make an example for you.

 
//

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
24th June, 2013 at 24/06/2013 02:17:01 -

I have actually have this in my game for "giant coins" and "Heart Containers" (like zelda) i did it with an array and just got each coin to check if has been collected before and if so then its not created. Simple. each Coin has an array position and if it is collected it turns 0 to 1 and then when you re enter the zone it will read the 1 before creating it and then skip it.

There are loads of ways to do it but i think ini or array is best, Globals would be slightly unnecessary and annoying if you have many in use for other things.

 
n/a

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
28th June, 2013 at 28/06/2013 16:12:31 -

Thank Windybeard, and you too nim! I'll sure to be in touch if I get stuck.

 
Image

Tell 'em Babs is 'ere...
   

Post Reply



 



Advertisement

Worth A Click