Jump to content

Recommended Posts

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.

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

 

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.

  • Thanks 1

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.

  • Like 1

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.

  • Like 1

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...