Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Colisions Masks

I need to know if there is a way to create colision masks in rmxp.

Like for example I need to create a colision mask for a circle, I want that it would not move if any part of it is in a not passable area.

Is it possible?


I have tought of a Idea for doing this but still, i don't think its very efficient,

I would create a Mas module that would hold all the possible masks, like all the points that the mask has in a array (for ex), and to check the colision it would check all the points and see if the position is passable in all of them.

As you see it is not that efficient because it would lagg alot!

Do anyone has ideas for that?
 
Just the the get_pixel method of the bitmap class.

Code:
if <your_bitmap>.get_pixel(x, y) == Color.new(255, 255, 255, 0)
  # your code
end

I just did this a few days ago updating an old script that limits the cursor to be bound within a circle. If you would like I see what I did, I can post it for you and explain everything in more detail.
 
Sure seph, but what I want is like this I have a circle bitmap, and I want that with F0tz pixel script the player could be a circle for example, and the colisions would be with a circle instead of the default square/rectangle. Hope you understand, and I would realy like to see your script maybe I can get the Idea from you.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top