Page 1 of 1

A little help, please :)

PostPosted: Mon Aug 29, 2011 9:00 pm
by Hblade
Hey guys, I'm stuck with a glitch. Currently I'm using physical response (top side of land) with these values: 1, 1, 0, 0, the normal value to stop the player. The collision actor is actually a box (Well was, then I used Game A Gogo's collision mass as an attempt to fix the glitch, resulted in a failure), what happens is, the player is parrented to the collision actor, (The box, or rather GAG's mass), but when you collide with a tile thats one, or 2 tiles up (Left or right side of the tile, which has the double yvel=yvelocity thing, then physical response to prevent sticking to the wall), but anyway, the player (box too, I guess), will FLY to the top of the tile then fall back down. I dunno why or how to fix this. I don't understand O.o None of the pixels of GAG's mass is touching the top side of the other tile either.

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 9:04 pm
by skydereign
Can you elaborate any? Perhaps code, pictures, ged example...

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 9:11 pm
by Hblade
Code yes. The ged has quite a lot of it in there so I guess it'd be useless to post it. Once again sky thanks for showing interest in the post where I require help. Heres the collision actor's code.

Code: Select all
//Collision with Left or Right side of land
//[regardless if it says "if jump==1" or not it does the same thing]


double yvel=yvelocity;
if (JUMP==1) {
    PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 0.000000, 0.000000);
             }
yvelocity=yvel;


Top side:
Code: Select all
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 0, 0);

Thats.. about it o.o besides seperate collisions with the left and right side that make the player stop moving.

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 9:35 pm
by skydereign
Not totally sure what you mean about the actor moving to the top of the tile, and then back down. It sort of sounds like the actor is going into the tiles, and therefore moves up or down due to collisions. Also what is this collision mass? Is it from Game A Gogo's super mario collision example?

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 9:37 pm
by Hblade
Yeah its from that. before, I was using a white square, still same bug. And you may be right. The game's frame rate is 60, and the player moves 3ppf, (pixels per frame), so he might be entering the land as you said. However strangely, before this glitch never happened, although I was using the actual player for the collision, though, which made him spas when using the chain.

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 9:47 pm
by skydereign
Well, it'd be obvious if the actor was moving into the tile, and from the small test I just did, a speed of 3 wouldn't be enough to move through the tile. From the setup I did, which I think closely matches what you have given me, I didn't see the problem you mentioned. You made a post asking how to become a better programmer, one way is to learn to isolate your bugs. For instance try to make it happen in a smaller ged that only has the necessary bits. If you can do that, you'll have a better understanding of the code used, and usually be able to fix it. Since I couldn't replicated it with that code, either the images you are using have an influence, or, more likely there is something else in your code that impacts this. Just to make sure, can you upload the tiles you used?

Re: A little help, please :)

PostPosted: Mon Aug 29, 2011 10:11 pm
by Hblade
Sure.

The white box was the first collision box.

Also, thanks for the isolation tip.