This site requires JavaScript, please enable it in your browser!
Greenfoot back
EnderPicture
EnderPicture wrote ...

2015/1/10

Having trubble with only one side of my collision code

EnderPicture EnderPicture

2015/1/10

#
Here is my code. http://pastebin.com/ViGnsBKb Every other side is fine except the left side, every time the character got collided on the left side, it will get stuck, and not move anymore, until the character jump to uncollide with the left side, then, the character is released. I think it is having something to do with resetting the x velocity. This code works before, one day I did not know what happened and the right side started to react like this. Trying to fix the right side, trying multiple things. One day it randomly worked again. But the right side started behaving like the right side. I really do not know what is going on.
EnderPicture EnderPicture

2015/1/10

#
http://www.greenfoot.org/scenarios/13054 Here is the scenario
danpost danpost

2015/1/10

#
Is there a reason you are using multiple collision points for each side of the actor? That seems to be quite a lot of code just for collision checking. Wait, I did not see your second post. Let me look at it.
EnderPicture EnderPicture

2015/1/10

#
I used multipurpose Because I want my Character to be able to stand on thin slices of ground
danpost danpost

2015/1/10

#
EnderPicture wrote...
I used multipurpose Because I want my Character to be able to stand on thin slices of ground
Why cannot you use normal intersection detection with that?
EnderPicture EnderPicture

2015/1/10

#
I need it to return what each side are touching and which side is touching I need to know if it is ice, on the ground, or coin block on above and so on.
danpost danpost

2015/1/10

#
None of those type objects are usually ones that move. So you can use the direction the actor moves as an indication of where (left/right/above/below) and use can use the 'instanceof' conditional operator to determine what (ice/ground/coin/etc).
EnderPicture EnderPicture

2015/1/11

#
I really would like to have a versatile core so there will be more level design options and possibilities. Having each side of the collision system run all the time will allow me the use moving platforms pushers and also moving coin blocks ice blocks ext.
You need to login to post a reply.