LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

help with bg collision 2#

Root / Programming Questions / [.]

Tiger2Created:
I have asked this before, but I don't get help I can understand. Can someone make a program where there is just one thing, a single bg tile or a few, and a sprite that collides with it. I know how to do this, but it is buggy and the sprite can go deeper into the block at the corners. I am looking to fix this. I tried sphitrec, but it was complicated and hard to understand though I did it a couple of times. I think I prefer figuring out how to fix bgget. I already looked at programs like platform, but it is so full of other things that I got lost and confused and eventually gave up. Later, though I wish I could now, I also want to know how to get sprites to collide with the actual pixels of the bg tile so that I can have slopes etc without the sprite looking like it is floating because it collides with the square character instead of the pixels.

Hello again, how is life? Did you manage to demystify arrays yet? If you haven't you will want to work on simpler projects until they are second nature. A tile based platformer uses arrays or at least array concepts. The tile map itself is pretty much a big two dimensional array. I feel like the #2 in the thread title is you blaming us the community. Blaming us for not giving you exactly what you want in the way you expect it. Suddenly it is now our fault if you don't succeed instead of your own. That being said, I want you to succeed. You are free to ask as many questions as it takes, and it makes me glad to hear that you tried out sphitrec. One problem is a simple scene doesn't really simplify the code. You still need all the same code for a dozen tiles as you do for hundreds. Taking out something like scrolling will simplify things. If you want that, I have Find the Exit. In Find the exit, you can also draw a level as simple as you like by modifying some data statements at the end of the code. You should expect that no matter how you do it, a platformer game will be hundreds of lines long. For the last paragraph, basically anything on the 8 or 16 bit game consoles largely faked sloped tiles. You have either a formula (y = mx + b) or a lookup table (array of heights at a given pixel offset into the tile) that says how far down the character can fall or how much to adjust their y position while walking back and forth. Something like Angry Birds will instead use a physics engine like box2d, and I think everything was per pixel collisions on worms. All that said I heavily suggest that you will want to keep things as simple as you can for now. Add that stuff in after you have a simple version working. In fact you might want to simplify things even more and try a 2D top down maze game where the player moves a full tile each time they move. That should make bgget dead simple. Since I seem to make things too complicated, perhaps this link will help. https://jonathanwhiting.com/tutorial/collision/. The code is in Javascript but as long as you get the concepts I think it should help.

Thank you As for the #2, I apologize if you felt that way about it. I did not mean to blame, I just put that there so people understand not to answer the same way they did in the first since I did not understand. I wanted them to know there was a #1 and it didn't work out, so I needed extra help. I had posted this question a number of times and I got practically the same reply. So again, my apologies.