The Daily Click ::. Forums ::. Klik Coding Help ::. custom platform movement probs
 

Post Reply  Post Oekaki 
 

Posted By Message

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
7th August, 2005 at 20:08:03 -

making a custom engine for a platform, the probs im having is with collision
basicly what im doing is..

i have created a collision object that follows the character. one in front, one behind. when the overlap a bg moves the character x-1

it works but the character and screen bounces around alot. looks kak.
anyone know how to fix this or a better way of doing things.

thx

 
n/a

hop



Registered
  16/03/2005
Points
  916
7th August, 2005 at 21:01:24 -

I think you will have to explain it a bit better. What do you mean by x-1? I figure this is the right detector you're talking about and it moves the x position of the charater back one, but unless your character is moving at max speeds of 1 pixel this method wouldn't work anyway.

There are better ways of doing things, ways in which require no detectors at all, but those can get complicated.

 
Working On:
Psydude
Castle Wars(working title)

XBLGT: sunstrike9

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
7th August, 2005 at 22:22:32 -

yeah its the right detector, but if you could guide me in the right direction that would be fantastic, im aware there are many better ways of doing this and i have searched and came up with nothing, so please could somone help?
(And cool avitar btw)

 
n/a

hishnak



Registered
  18/04/2004
Points
  994
8th August, 2005 at 08:24:41 -

You can have two counters for the X and y pos.

Then you might say something like this...

Always----set X pos. to X pos. of player+ Value of X counter

Try it out...

Upon presssing rigt arrow----add 1 to X counter

If you put a right detector on him you could say something like this...

Right detector colides with background set X counter to 0

Thats just the very basics...

To make some simple gravity do this

Always----Set Y pos. to Y pos. of player+ Y counter/5
Run this event once----- Set Y pos. to Y pos. of player+ Y counter*5

Try it out

Upon pressing enter-----Set Y counter to -30(The Y axis is inversed in TGF)


 
I'm feeling a bit wella

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
13th August, 2005 at 14:37:14 -

hishnak, wouldn't your example end up permanently stopping horizontal movement upon colliding with an obstacle?
Antworx, if you don't want it to jump around, just restrict the movement when the detectors overlap instead of repositioning the object. i.e:
Player 1 is moving right
+ right detector is not overlapping obstacle: set x to x + 1

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

hishnak



Registered
  18/04/2004
Points
  994
20th August, 2005 at 20:56:26 -

Right detector is overlaping Obstacle AND upon NOT pressing left arrow set x to 0...Simple fix man. I was just giving the general idea.

 
I'm feeling a bit wella

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
22nd August, 2005 at 22:41:33 -

cool, but im still having trouble, basicly all your ideas sound good, i have the movement down already, (using the PMO object) and none of them worked, any other ideas?

 
n/a
   

Post Reply



 



Advertisement

Worth A Click