The Daily Click ::. Forums ::. Klik Coding Help ::. i need help with custom movement collisoins
 

Post Reply  Post Oekaki 
 

Posted By Message

Fish20



Registered
  03/12/2007
Points
  263

VIP MemberPS3 OwnerI like Aliens!I'm a Storm TrooperIt's-a me, Mario!I am an April FoolPicture Me This Round 48 Winner!
15th December, 2007 at 21:06:56 -

i need help with custom movement collisoins. In my sky-view game i have a cutom movement and i can't get it so that if you collide with the backround you stop.

 
All your base are in another castle, take this.

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
15th December, 2007 at 21:49:40 -

That's quite sparse on information.
Don't you use any detectors?
If you do, only add conditions that hinders the movement in a specific direction when appropriate detector is overlapping background.


Image Edited by the Author.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
16th December, 2007 at 11:04:27 -

it depends on how you made your custom movement. But the most common way to do it is to have four detectors on each side of your player character.

Then if you have an event that says

upon pressing left, move player object's X +1

add another on that same line,

whilst right detector is NOT overlapping an obstacle. (assuming your detectors are called that)

 
.

Fish20



Registered
  03/12/2007
Points
  263

VIP MemberPS3 OwnerI like Aliens!I'm a Storm TrooperIt's-a me, Mario!I am an April FoolPicture Me This Round 48 Winner!
17th December, 2007 at 15:53:32 -

well i made a custom movement with the "player presses direction" conditions. The thing with not overlapping backdrop doesn't work because he can't move forever. I don't use detectors.

 
All your base are in another castle, take this.

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
17th December, 2007 at 19:19:46 -

Well, in what manner are you moving the character? Are you using MMF's built-in movements with "speed" or are you moving it with XY positioning? If you use XY positioning you are bound to need detectors if you're not making a very advanced engine.
I suggest you add detectors to your movement engine, they're almost always easy to implent in different types of coding.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Fish20



Registered
  03/12/2007
Points
  263

VIP MemberPS3 OwnerI like Aliens!I'm a Storm TrooperIt's-a me, Mario!I am an April FoolPicture Me This Round 48 Winner!
18th December, 2007 at 16:26:56 -

ok wait i want to ask. why use a custom movement to replace 8 directions?

 
All your base are in another castle, take this.

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
18th December, 2007 at 16:30:01 -

The built in 8 Direction is alright, but it has problems; mostly the lack of decelleration when you change direction. Plus using the built in movements doesn't give you the kind of control you could get from a custom engine.

An 8 direction movement is a great way to start coding newbie custom movements though.

 
Craps, I'm an old man!

Fish20



Registered
  03/12/2007
Points
  263

VIP MemberPS3 OwnerI like Aliens!I'm a Storm TrooperIt's-a me, Mario!I am an April FoolPicture Me This Round 48 Winner!
18th December, 2007 at 16:40:58 -

ok i guess it is better. but i still can't do the collisions even with detectors because the player's object stops forever and can't move any more.

 
All your base are in another castle, take this.

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
18th December, 2007 at 18:28:52 -

Well, that's cause you're doing it wrong. It's important to make sure you only "stop" the movement once, not forever glue the character to the wall.
Make a search in the articles section for custom movement engines or the like and I'm sure you'll find what you need.

Oh, another reason for the 8-dir movement's suckiness, if you walk alongside a backdrop and simultaniously move against the wall you'll turbocharge forward.


 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
19th December, 2007 at 11:49:08 -


Originally Posted by fish20
ok i guess it is better. but i still can't do the collisions even with detectors because the player's object stops forever and can't move any more.



well if you have detectors you can make the player object stop when the detector is overlapping a background, not when the player does. If you have one for each direction, make the event only work when the player is pressing a said direction.

eg
pressing left + left detector not overlapping = move left
then another event
pressing right + right detector is not overlapping = left right

this way the player will only be stuck as if you continue trying to move into the object when you've hit it. pressing another direction will let you move away.

 
.
   

Post Reply



 



Advertisement

Worth A Click