The Daily Click ::. Forums ::. Klik Coding Help ::. what's a good way to make an rpg movement engine?
 

Post Reply  Post Oekaki 
 

Posted By Message

NMasutaa



Registered
  26/12/2004
Points
  301
6th April, 2007 at 11:48:23 -

I've done it before, but I've just never been able to do it very well. Basically, I'm trying to find out what's a good way to make an 8-directional movement (free, not grid-based) that tests collisions at its feet, so that it can give the character the appearance of standing in front of backdrop objects. Also, I need to know details like how to make the character's walking animation stop whenever it's colliding w/ the backdrop, etc.

 
n/a

jpSoul



Registered
  25/10/2003
Points
  1714
6th April, 2007 at 13:11:52 -

I've maked that easily but I had 1 major problem: the character can't slip when it touchs a diagonal obstacle... I've tried some differents engines with 4 captors positionned in lozenge, the result was rather good but not perfect...
the lozenge is a good idea to have a slipping-collision engine, the system is simple: when 1 captor touch an obstacle the player is moved up, down, left or right (depending of the captor in collision and the keys you are pressing); and when 2 captors are in collision the player stops (I speak about 2 captors at the same side of the player, beacause it's a lozenge, in that case if you run left and touch a wall there were 2 captors overlapping with the obstacle; if it were a square that would be only 1 captor).
sorry if I explain really badly -_-

Image Edited by the Author.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
6th April, 2007 at 13:23:44 -

i fixed that 'not being able to slip' thing by rearranging the events.
i just made the events like this.

.repeat while press up, move object -2 to the Y coordinate
.repeat while press up + overlapping obstacle +2 to the Y coordinate
.repeat while press down, move object +2 to the Y coordinate
.repeat while press down + overlapping obstacle -2 to the Y coordinate

and repeat for left and right, it seems to work fine for me.

oh and for the collisions at your feet? just make a small 8x8 (or whatever) square and use that as the main character, then make your character follow it so it's behind their feet.

 
.
   

Post Reply



 



Advertisement

Worth A Click