The Daily Click ::. Forums ::. Klik Coding Help ::. MMF2 - Virtual Level Size
 

Post Reply  Post Oekaki 
 

Posted By Message

cosbish



Registered
  07/12/2006
Points
  26
6th January, 2007 at 01:27:36 -

I am confused about how to use the virtual level size. I have many levels exceeding 9999 in width, and before MMF2 I was just having my player move to the leftmost side of the level when he reached the right, only lower. I am wondering if I can make the two sections flow together by using the virtual level size to increase the horizontal length of the level so the character can continue without having to teleport to another part of the level. However, I cannot paste the entire second section after the rightmost part of the level, because it will be offscreen and I will be unable to edit it later.

So, is there a way I can either

1) make it so that when the player reaches the edge of the screen, the next section occupies the following virtual width
or
2) extend the actual area of the level/ area outside the level

What I am looking for is difficult to explain, so if you don't understand what I'm asking I can try and clarify it. Thanks.

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
9th January, 2007 at 05:21:21 -

Basically, are you trying to create a looping level (where you can seamlessly wrap from one end to the other)?

I don't think virtual level size would help. That's mainly (so far as I know) for people making custom level editors. Suppose you code a game to use your own level editor, and you start out with a frame that's 640x480px big. But certain levels are larger than that. You can use virtual frame size to make the frame continue past the edges of the map.


If I've understood your objective correctly, what you need to do is just take a LOT of care in how the level is designed.

Suppose your game window is 640x480, and the frame width is 9999px. When the player reaches 9679px (9999 - 640/2) he is repositioned to 320px (640/2).

You then make sure, by taking screenshots and stuff, that the level looks EXACTLY the same on the left side as it does on the right. So all trees and plants are the same at those positions.

When the player reaches one end, it'll look like he's just continuing on a seamless playfield.

 
191 / 9999 * 7 + 191 * 7

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
9th January, 2007 at 09:38:41 -

Just a small point, following on from what Dines said: if you use this method, and you have other objects/enemies on the playfield, you can make them scroll properly by having them not follow the playfield, and have them repositioned properly whenever the player moves (i.e. when the player moves 1px right, reposition all others 1px left etc.). So when the player character hits the edge and is repositioned, everything else will be in the proper relative position too. Note that this only applies to things that need to make the jump seamlessly.

 
n/a

Nioreh



Registered
  18/11/2002
Points
  1078
9th January, 2007 at 10:13:54 -

He is not trying to make a looping level. He just wants a level wider than 9999pixels. Sorry, I can't help. But hopefully someone can. Good luck.

 
Its hard to be religious when certain people are never incinerated by bolts of lightning.

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
9th January, 2007 at 13:31:45 -

Don't, that would take up too many resources.

 
Old member (~2004-2007).

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
9th January, 2007 at 15:14:19 -

Not if all the objects are set to load on call, and inactive if far from the screen.

 
http://www.facebook.com/truediamondgame
   

Post Reply



 



Advertisement

Worth A Click