Platformer game problem
Twayne2
Member Posts: 458
So I have a ground actor that spawns itself to the right for 1.5 seconds exactly on the same y coordinate but different x coordinates. (So a line like this ---------.) But as the actor walks on it he sometimes gets caught on an edge that's not there. Any help?
Like this dot: ______._______ , but the line is, but definition, straight.
Comments
For starters, I would put a Display Text with self.Position.Y on the ground actors and the main character actor and see if the value varies at all. Could it be possible that the main character actor moves slightly up or down? Is bounciness set to 0 for both types of actors?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Try setting the bounciness of the actor to 0.08 , or any small value that wouldn't effect the gameplay. The slight push from the bounciness will allow the actor to pass the edge without getting stuck.
I tried the display value of y coordinates and there was no change when I got stuck. I will try the low bounciness and see if that works. Thanks!
I still got stuck.
I mean, how else do platformer programmers make a long line of tiles? Instead of putting the tiles 1 by 1, I want to make them quick, (and it works all right.) Replicate sadly does not mimic attributes. Any help?
Can you share your movement rules ? How are you moving the player ?
Hey, I just finished my platformer.
The app is currently under review on iOS and I am waiting for the release.
As I started, I encountered similar problems as you have.
I have set tiles of 64x64px. This is a lot of work and after the first level I had the problem that my actor not only needs the floor, but also walls.
So my Actor don´t collide with the Block-Tiles, but with a second floor, called Ground. And there is another actor, called Walls.
Therefore, I can set my tiles as I would like and does not have to pay attention how they line up.
In the scene it looks like this...2 Layers
1. Tiles (visible)
2. Ground/ Walls (Change Alpha to 0)
Then you put the Actor Ground behind your visible tiles.
And what I would recommend to you, create your own CollisionShape for your character. With this you can already solve a few more problems.
With it, my Player works with bounciness "0"
Here is a video of my Platformer, which will hopefully be found in the store in the next few days.
Daniel
dapion.de
[https://twitter.com/dapionde?]
But that is more work. Lol. I use the change linear velocity behavior.
Use constrain linear velocity instead , then try setting the bounciness to a low value, try 0.1 or 0.09 , play with the value.
So if right arrow is pressed, constrain instead of change? Would constrain go through the edge? I will try it out sometime today.
Yes constrain instead of change , and don't forget to set the bounciness to a low value,try and tell me if it works
Shoot, I forgot to try it out. I don't think it will work, but if I remember to I will post here the results if I try it today.
Somehow, in some way, your solution worked!!!!!!!!!!!!!! Thank you so much!!!!!!!!!
1 awesome coming up!
Awesome , glad it did thank you
Oh no! While I was playing it started again! It was after added a timer to something that had not even happened yet... weird. Anyways, after I got rid of the timer, for now it is working. Why? I hope it will not happen again. Is 500+ tiles in one scene too many? (I am guesing the amount, I really don't have an accurate count.)
If it only happens after you add a timer to something that had not even happened yet , then this timer to something must be the cause to your issue, you must do something about it. You should re structure your code break it down into small logic blocks and try to figure out why this timer to something is breaking everything.
I think it will still happen, but who knows. I hope not.