The Daily Click ::. Forums ::. Klik Coding Help ::. Toroidal universe in MMF 1.5
 

Post Reply  Post Oekaki 
 

Posted By Message

Dave S.



Registered
  26/09/2003
Points
  924
11th November, 2007 at 13:24:35 -

What is the easiest way is to create a toroidal universe style map in MMF? For example, if a character were to walk far enough in one direction (say two screen widths) he/she would come back on the other side. The same would happen in all directions. If anyone remembers 'Dungeons & Dragons' for the Mattel Intelivision games console then you'll know exactly what I mean.

 
n/a

Joe.H

Evil Faker

Registered
  19/08/2002
Points
  3305
11th November, 2007 at 13:55:02 -

There's an option that you can set a condition for when the character leaves the play area, that the movement will loop, i.e he will appear at the otherside and start again.

 
My signature is never too big!!!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
11th November, 2007 at 14:08:26 -

Only works for the built in movements I think.

 
Craps, I'm an old man!

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
11th November, 2007 at 17:50:23 -

Well, its not that hard to do anyways even if its not possible with custom movement (i think it is tho. not sure). compare x and y pos of the character.

e.g

Hero X Pos >400 - Set Hero Pos X = 0
Hero X Pos <1 - Set Hero Pox X = 399

Something of that sort. it should work for both x and y.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Attan



Registered
  13/03/2007
Points
  136
11th November, 2007 at 17:55:48 -

Make it bouncing ball movement, and set the speed to "0". Then create whatever custom movement you want and write:

*(object) leaves the play area
-(object) wrap around play area

Think that is the easiest way. Then you have to make the camera move smoothly and not make an ugly jump when you wrap around (if you have scrolling of course).

 
n/a

Dave S.



Registered
  26/09/2003
Points
  924
12th November, 2007 at 04:19:16 -

Thanks for the info but the main character will always be centered with the world/universe moving around him/her. I can do this part but not sure how to wrap the background (say, four times the screen size) and not the character. I take it that no one remembers 'Dungeons and Dragons' for the Intellivision then?

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
12th November, 2007 at 11:13:23 -

There was a question like this recently. You might be able to find the thread somewhere.

But a good way to do it is to make half a screen width extra at the edge of the world the same as half of the screen on the other edge. Then make the object move to the position on the other side of the level.
If done right it will be seamless.

i could make a tutorial because it's dead easy to make really. Even for someone useless at programming like me.

ok done

http://www.ectoprods.com/uploads/wrap.zip

made with The games factory.

Image Edited by the Author.

 
.

Dave S.



Registered
  26/09/2003
Points
  924
12th November, 2007 at 16:17:51 -

Andy... just tried it... looks good, many thanks. Earlier I had recovered something similar which I remember doing many years ago (I knew it was on disc somewhere). Mine works differently by the repositioning of quadrants of the universe rather than the character itself... it wasn't seamless like yours though unless I were to use a thick border... seems so obvious now, cheers.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
12th November, 2007 at 20:19:37 -

no problem mate.

 
.

Dave S.



Registered
  26/09/2003
Points
  924
13th November, 2007 at 03:15:10 -

Andy, something has just occurred to me... what happens if you have monsters roaming the maze/universe? I think they might appear and disappear depending on the location of the character as some screens are duplicated.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
13th November, 2007 at 10:53:54 -

i never thought of that.

maybe you could make enemies move along with the player?

as in keeping track of how far away the enemy is from the player and whenever the player hits one of the edges the enemies position is changed to make it appear the same distance away.

If i'm right it would appear to never have moved.

 
.

Dave S.



Registered
  26/09/2003
Points
  924
14th November, 2007 at 16:51:41 -

Andy, I've also noticed that the faster the character moves through a screen at the edge the more noticeable the change. I couldn't find that earlier post that you mentioned... do you remember any words in that question... then I could do a search, cheers, Dave.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th November, 2007 at 11:20:40 -

You might be better off just looking through the links manually since there aren't all that many topic in code it.

um... this might be it, but i'm sure pixelthief made a diagram showing how to make it yourself...
that code by davince might be usefull.
http://www.create-games.com/forum_post.asp?id=200967



 
.

Dave S.



Registered
  26/09/2003
Points
  924
15th November, 2007 at 15:40:58 -

Tried the link... but who is pixelthief? It's basically what you said all along. I'm trying to work out what DaVince has written... cheers mate.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
15th November, 2007 at 17:21:22 -

Pixelthief is the bloke with the cookie monster avatar.

 
.

Dave S.



Registered
  26/09/2003
Points
  924
18th November, 2007 at 09:03:06 -

By the way I tried a few enemies but they were all a bit quirky in their movement. I set them to ball movement (using the same four lines of code for wrapping) and followed them with the main character to see what they did. At the wrap point sometimes they would disappear then reappear... couldn't work out what was going on... so I gave up...

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14560

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
19th November, 2007 at 14:00:18 -

It's complex i know.
I'm not actually a very good coder in all honesty.
but there should be someway to make the enemies wrap seamlessly too.

Maybe if you make the enemies only wrap when they reach the edge of the frame,

and reposition by as much as the player does when the player wraps, then it should work i think.

 
.

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!
3rd December, 2007 at 01:17:37 -

I remember doing this by having the enemies not scroll with the background, and move in the direction opposite the player when the player moves.

keyboard: repeat while 'right'
--Player: set X to X(Player)+1
--Enemy: set X to X(Enemy)-1

That was an arcade-style game though (a Fantasy World clone), and would probably foul up if you needed enemy background collisions, unless you had half the playfield replicated in each direction around the playfield rather than half a screedwidth. But the advantage is you're taking advantage of one of MMFs object positioning modes rather than manually repositioning dozens of objects when you wrap.

 
n/a

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
3rd December, 2007 at 04:33:02 -

(omg its radix )

 
http://www.SilverNova.co.uk

   

Post Reply



 



Advertisement

Worth A Click