The Daily Click ::. Forums ::. Klik Coding Help ::. Day time night time logic for platformer with progress map.(and INI files)
 

Post Reply  Post Oekaki 
 

Posted By Message

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
13th January, 2004 at 03:27:25 -

Hey,

This is a life death situation,
someone in a third world country might die!

Like the above name says, can anyone please tell me
how to change the playfield background color during play.

Also, I haven't got the slightest idea how to
store multipul values in ini files or save the positions of multipul
copies of the same object.

Please help!

 
n/a

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
13th January, 2004 at 05:49:29 -

TGF definitely can't do this unless you make the background be an active object and thus make the platforms be active objects as well.

I have no idea if MMF can do it. I'm not yet familiar with all the MMF extensions.

 
n/a

Ashman

Possibly Insane

Registered
  12/06/2002
Points
  3974
13th January, 2004 at 06:23:42 -

You could use the image object and enlarge it as the background then load different coloured images but there would probably be so many problems with that it wouldn't be worth it.

Try it though.

 
Show me the power child,
I'd like to say,
That I'm down on my knees today,
Gives me the butterflies,
Gives me away,
'Til I'm up on my feet again,
I'm feeling outshined.


"Outshined" - SoundGarden

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
13th January, 2004 at 15:44:47 -

NO NO NO BECAUSE THAT WOULD LIKE REALLY REALLY SUXOR. REALLY.

Try fiddling with the palette object. Or move the player to a completely different frame when it gets to night.

And save the options with a fastloop and a spread ID system, if you really want to know consider the Save Game object as it saves stuff by auto.

 
gone fishin'

Cazra

Crazy?

Registered
  24/07/2002
Points
  4472

Game of the Week WinnerVIP Member
13th January, 2004 at 18:09:00 -

Hopefully MMF 2 with it's layers will come out soon. I'd either wait for that or Make a day level, and then once you get half way through the level, make it a night level.

 
n/a

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
14th January, 2004 at 13:33:46 -

How would layers help? O_o

 
gone fishin'

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
14th January, 2004 at 13:36:16 -

both night and day backgrounds on the screen at the same time, but one in front of the other

 
My signature is never too big!!!

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48487

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
14th January, 2004 at 13:55:27 -

NonoNO!!!

Make two background system boxes, and draw a daylight image on one, and a nighttime image on the other. Then use my tutorial (in the Articles section) to teach you how to use the BGS.

Basically, if you want day to change to night you need to send the night BGS to back, and vice versa. But doing it that way would be sudden, so you might want to make a THIRD BGS with a sunset or sunrise.

 
n/a

danjo



Registered
  15/01/2002
Points
  641

Acoders MemberGOTM NOVEMBER - 2009 - 3RD PLACEI am an April FoolVIP Member
14th January, 2004 at 15:34:55 -

blatant plug for his own tutorial

 
n/a

cake



Registered
  13/12/2002
Points
  1173
16th January, 2004 at 05:31:46 -

The most efficient and manageable way to do this is store the level data in an array or ini or list. Then have 2 set of background tiles, day and night.
Then to transition from day to night and vice versa, activate a fastloop to scan through the array/ini/list and paste the appropriate backgrounds in.

That way you maintain low file sizes (no big images need to be stored) and the code doesn't have to be modified for any other levels.

 
n/a

wp



Registered
  22/11/2003
Points
  34
16th January, 2004 at 06:03:02 -

How do you use fastloop, specifically, to scan quickly through INIs and such?

 
n/a

Rycon



Registered
  20/09/2002
Points
  996
16th January, 2004 at 06:52:55 -

Or make a big white image, and invert it in the event list

 
We are the music makers, we are the dreamers of dreams...

RapidFlash

Savior of the Universe

Registered
  14/05/2002
Points
  2712
16th January, 2004 at 20:31:24 -

Or you could have two active objects (sorry, I haven't tried the BGS object), one night and day. The night slowly creeps down using a timer/loop based event (and changing the y of the night background). Then, after a while, use a timer/loop based event to raise the night object back up until it's off screen. Repeat.

 
http://www.klik-me.com

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
16th January, 2004 at 21:58:17 -

The bad thing about the Pallette object is that its not compaitable with Windows XP.

 
HES homepage:
http://www.distinctiv-efair.com/heretic/studios
Crystal Clear Productions: http://www.distinctiv-efair.com/heretic/crystalclear

cake



Registered
  13/12/2002
Points
  1173
17th January, 2004 at 18:12:15 -

wp:

There are several scanning methods you can employ to scan array-styled data. The only way to store 2 dimensional level data in INIs is to use delimitters, like this:

[Level 1]
0=0;1;0;4;10
1=1;1;4;3;7
2=4;0;0;4;0
3=0;1;2;0;10
4=0;1;0;4;10

etc. Then you use string parser to break up each of these delimitted strings into their separate pieces.
To scan through this 2d data using fastloop, you need to scan each row at a time, and during each row, each column for that row. That's 2 loops. But it can also be done with just 1 loop that loops for <width * height> number of loops and using a couple of little formulae to get the data. It's up to the person which method they use, but these are the two I use, and I will explain them-

Actually, you know what? I might as well write an article and link it here

 
n/a
   

Post Reply



 



Advertisement

Worth A Click