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
  48488

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
  741

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

renneF



Registered
  02/08/2003
Points
  672
17th January, 2004 at 18:18:18 -

please do

 
Image

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
17th January, 2004 at 19:42:23 -

what about:

[level 1]
0,0 = 1
0,1 = 2
0,2 = 3
1,0 = 4
1,1 = 5
1,1 = 6
...
3,3 = 10

etc

 
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
17th January, 2004 at 21:41:19 -

Easiest method?
Make a counter that tells what time of the day it is. from 0 to 23 (11 PM). When the counter reaches 24, set it to 0. You can also do another minute counter if you want.

Make a large full-screen black active object and set it to enough transparency so that it looks like night. We'll call this number X.

Set an event so that when counter = 0, set active object transparency to X.

Then just adjust the transparency accordingly to the time of day. Sunrise and sunset times can really vary.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Deleted User
18th January, 2004 at 00:10:30 -

Muz's method would work, but MMF would slow down horribly.
I actually know an awesome way of making night and day systems, but I'm not going to tell about it here. It changes from night to day, and viceversa in runtime, everything darkens, lightens, etc.

 

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
18th January, 2004 at 00:22:59 -

Sorry, forgot to mention that. I don't think it really bothers MMF 1.5, since most of the other 'really slow' stuff seems a lot faster in the new MMF. The main problem would be that your file size could increase significantly, especially if you're using 16 M colors, have a large screen resolution, and use it on multiple frames.

Alonso, why not make a tutorial for your style? You could gain a little fame from everyone who uses it...

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
18th January, 2004 at 05:14:50 -

Yipeeee! Muz saves day. - I'll do just that! TGF style.

And I can set the direction of the filter according
to the day to create fog, sunset or whatever!

Authough I don't under stand everyones explanation of
the Ini solution, .. Or how to set a objects transparency effect in
the events,

Thanks All For Your Help!


 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
18th January, 2004 at 05:18:35 -

You're using TGF? My idea was meant to work with MMF 1.5. TGF's gonna run reeaaaaallly slow if you go with my idea.

Well, maybe it won't. Maybe that was anti-aliasing, not transparency.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

cake



Registered
  13/12/2002
Points
  1173
18th January, 2004 at 05:20:33 -

Article is at:
http://www.create-games.com/article.asp?id=1262

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
22nd January, 2004 at 02:46:11 -

Yea, I am using TGF.

Time for the lazy way out and just paste an
active object over the playfield.
I can make different objects with different transparency
rates for different times of the day.
- Or fork out cash for MMF.

But I'ts cleared up a few q's that I needed to know.

 
n/a

Deleted User
1st June, 2004 at 07:04:44 -

I don't want to gain fame. Especially here, in DC.

 

Crystal Clear (H.E.S)

Possibly Insane

Registered
  06/10/2002
Points
  2548
1st June, 2004 at 07:34:40 -

Lol, ill have a go at a Day/Night system maybe later and see what i can come up with.

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

Keatonian



Registered
  15/07/2002
Points
  571
1st June, 2004 at 20:07:54 -

I still use TGF. Mainly because I have not the
free money to spend on mmf1.5, or when I do, I'll
want mmf2.

 
-Above post is ancient and probably irrelevant-

An old account of mine, recently cleared out. It's a blast to the past, the age was marked as 14 when I found it. If you know where to look, you can track me. Au revoir.
   

Post Reply



 



Advertisement

Worth A Click