The Daily Click ::. Forums ::. Non-Klik Coding Help ::. Pseudo Code for a home-made Layering System
 

Post Reply  Post Oekaki 
 

Posted By Message

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
26th March, 2009 at 00:46:50 -

Is there someway to create a sense of layers without an actual layering system?

Explain in TGF1 events ***OR*** simple Pseudo-Code style please.


 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th March, 2009 at 00:56:52 -

you can layer using a value and a fastloop.

+on loop (layer loop)
-value of (object) == current loop index
-bring (object) to front (or back depending on how you imagine it)

you can also create depth of playfield by looping from the top pixel of the scree to the bottom and if the y of an object == the loop index you bring it to the front making things farther up look farther back.

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
26th March, 2009 at 01:00:04 -

But you still can't put objects behind the backgrounds


which is precisely what I need.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
26th March, 2009 at 02:02:31 -

That's like a for loop huh?

So, how would that help me keep track of multiple instances though? ... Can it? ... I basically just need to change the focus of what the event affects concerning a spread value. The problem is that I have no way to tell it to PICK an object with the Value of the Spread that is closest to the character. Or if there's some other way, (that's the only solution I can think of to this infernal problem <if I ever figure out how to make it happen>, then I'd like to know.

I don't quite get the value of current loop index ... How do I change that value based upon proximity of the character to Instances of an active?
Is this at all possible?

Cecil, can you explain further for the problem above? I basically need to tell TGF to put only a certain instance at a given time to the back or front, but I don't know how to choose an instance by its spread value number.

It may be something really simple, I just don't know the command.

It's the final step to completing this 2.5d code, you'd be my hero man.


EDIT: Sweeeet !! ... I don't really understand what you said exactly, but I think it helped me Cecil, cause I've finally solved it in TGF1 terms

THANK YOU !!! Cecil !!

I'd still like to understand that for loop way you mentioned a bit better though ... I don't really get how that works.


Edited by MBK

 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th March, 2009 at 02:29:08 -


Originally Posted by Pixelthief
But you still can't put objects behind the backgrounds


which is precisely what I need.



thats not an obstacle you can overcome with tgf. i think youve pushed it almost as far as it will go

@mbk - glad you figured out what you were trying to do. not sure how much more i can explain it without overcomplicating it. if you want to do single instances of a group of duplicates read the article on handling duplicates

http://create-games.com/article.asp?id=1975

other than that, if you want more explanation on looping and why things work, pixeltheif here knows a lot more than me. not sure if he can explain it better though. im a terrible teacher.

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
26th March, 2009 at 05:20:42 -

And I'm still pushing it farther! :X

I want to come up with some way I can create parallax backgrounds for my platformer game, but in order to keep everything in 1 layer (2+ layers causes unacceptable slowdown), I need some object that can both load the background images and parallax them behind the actual backdrop layer. And I *found* that object with the Background Images Object.

Sadly greyhill won't update it until HWA is finished, so it can't display patterned images... yet

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456

MBK



Registered
  07/06/2007
Points
  1578

VIP Member
27th March, 2009 at 05:20:48 -

Why don't you just make a 3d code engine and a 3d viewer for it, all in TGF 1 and be done with it PixelThief? .... lol

That'd be the Ultimate Impossible Project, and would cover any game you'd ever need to make.

... You're already close. .... Make Halo 2 in TGF 1 !!! ... lol .. you know you want to.

Hmm, actually, just thought up something that your genius could probably tackle and make pointless to bother with that whole background thing you are thinking of doing PixelThief. .... Look for it here in a sec .. gonna post a new topic for it.

Edit: After some sleep I've realised that there's only 4 fake layers in TGF1 and only 2 ways to control them (to front and to back).
Well, I guess there is more in some of the picture file objects.


Edited by MBK

 
Click Me! http://www.create-games.com/project.asp?view=main&id=1444

http://www.mediafire.com/download.php?aoo1dnnlq5i

Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?

Eric Lism



Registered
  29/03/2009
Points
  51
30th March, 2009 at 12:15:57 -

You can't have stuff behind the backdrops without using layers, which actually makes all the backdrops on all layers but the bottom actives anyway, however if you use a system box (can't remember if it works with background ones, but I assume not) then you can paralax with them (old school style, This is how we rolled in MMF1.5) and the speed is pretty high. For the actual paralaxing you will have to have an event position them at (for example) [X Left Screen]/0.85 which will cause the system box to move at 0.85x the speed of scrolling (or approx 1/6 slower)

whether this is faster than just using layers, I can't say as I've not opened MMF in rather a long time.

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
30th March, 2009 at 13:19:19 -

we know. were talking about making a layer system in tgf1. which is the point. it doesnt have layers.

how is that of relevance?

new thread yet mbk?

 
n/a

Eric Lism



Registered
  29/03/2009
Points
  51
30th March, 2009 at 14:22:07 -

Err... I said Active System Box, this is an object in TGF1, and paralaxing does work with it, though you do have to do all the hard work yourself. Unfortunately I can't remember how System boxes interact with backdrops, so yu'd have to experiment for yourself.

If you think I'm ignoring the point again, feel free to tell me what the point I'm ignoring actually is.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
30th March, 2009 at 14:29:39 -


Originally Posted by MBK
Is there someway to create a sense of layers without an actual layering system?



I'm assuming they are talking about more than just a parallax background, they want to create their own layering system in tgf1 without the restrictions of the background system object.

 
n/a

Eric Lism



Registered
  29/03/2009
Points
  51
30th March, 2009 at 14:59:08 -

Right... my bad. For full sprite control in layers I have nothing to add to what others have said, that is alterable variables, fast loops.. Oh, the draw order within each 'layer' might change around under unusual circumstances, perhaps their layering would need to be controlled strictly as well.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click