ORART Posted November 4, 2021 Share Posted November 4, 2021 I'm trying to make a sample game with 3 or 4 sprites. The problem is the character collision with floor is not very precise when it comes to gravity (pfread function). I have seen in similar threads that you have to divide by a specific number depending on width and height, but i can't get it correctly. I use multisprite kernel with pfread. Here's what i got so far: Sample.bas Sample.bas.bin Any suggestions? Thank you. Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/ Share on other sites More sharing options...
+Gemintronic Posted November 4, 2021 Share Posted November 4, 2021 My impression is that bogax made a working pfread for the multi sprite kernel. But, no matter what I've tried I've never gotten a solution to work. This could very well be my own fault. Maybe you can find one of the working solutions and post it here. I'd love to be proven wrong UPDATE: Found the bogax solution here Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/#findComment-4938263 Share on other sites More sharing options...
+Lewis2907 Posted November 6, 2021 Share Posted November 6, 2021 Gemintronic, I ran into this issue. Bogax code works, but it need precise calculations when flipping the Sprite. Also RT made a sample program for DPC+ using the pacman style, but he could figure out the calculations for multisprite. My way around it was Brute Force. Just old school X and Y coordinates for the Pacman Multisprite game I was working on. Downside. This takes up a lot of memory and is a pain as well. I think you will crack the code as you have way more experience than I do. Plus I think some of skip over the multisprite for this main reason as it's hard to have smooth collisions like RR said vice the bouncy stuff. 1 Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/#findComment-4939821 Share on other sites More sharing options...
+Gemintronic Posted November 6, 2021 Share Posted November 6, 2021 The smoothest "slide along the walls" collisions I've found is to: * Hide a missile in the player center and use that to determine collision. When you revert the x/y position the rebound is hidden within the player sprite. * Check (and correct) for horizontal collisions one frame and vertical on the next frame. 1 Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/#findComment-4940052 Share on other sites More sharing options...
+Lewis2907 Posted November 11, 2021 Share Posted November 11, 2021 I tried that approach too, but I think my formulas and math were off. It would about 80% of the time. It seemed like when the sprite flipped that when I would have the issue. Even trying to off set it some I would end up in the wall. Holy someone can do a good collision code for multisprite. That's one reason I took a break on the pac man game and fee other ideas I had for multisprite. 1 Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/#findComment-4943909 Share on other sites More sharing options...
+Lewis2907 Posted November 11, 2021 Share Posted November 11, 2021 Orart, Looking at your game in my Android emulator. If it's just the floor. I would use x and y coordinates. It's a pain, but the code would be exact. If like my game moving around mazes and walls it a real pain jn the (a..). If you search the batari forum for pacman eat n run my "bloated" code is there. It works, but eats up space. Quote Link to comment https://forums.atariage.com/topic/326777-multisprite-kernel-pfread-checking-gravity/#findComment-4943911 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.