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
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