Discussion:
How to handle odd shapes in a 32x32 world
ER
2016-08-27 23:08:03 UTC
Permalink
Hi -

The game I'm working on everything, (tiles, characters) are 32x32
which is fine. However then
weapon that is "thrown" is not 32x32 it causes Out of Bonds exception
when it checks the grid/map to
see if it hits anything (i.e a wall). Now if I make the weapon 32x32,
which makes for a rather large knife
type weapon, all is good and happy.

So if I want to make the weapon smaller than 32x32 how do I handle it
in a 32x32 world ?



Thanks
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
Jon Ogden
2016-08-28 01:09:15 UTC
Permalink
Make the weapon a total size of 32x32 but with transparent pixels around the size of the weapon you want. Then when it hits a wall, just don't count it as a hit until the actual weapon hits the wall (don't count the blank pixels).

Sent from my iPhone
Hi -
The game I'm working on everything, (tiles, characters) are 32x32 which is fine. However then
weapon that is "thrown" is not 32x32 it causes Out of Bonds exception when it checks the grid/map to
see if it hits anything (i.e a wall). Now if I make the weapon 32x32, which makes for a rather large knife
type weapon, all is good and happy.
So if I want to make the weapon smaller than 32x32 how do I handle it in a 32x32 world ?
Thanks
_______________________________________________
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>
ER
2016-08-28 15:33:18 UTC
Permalink
Ah I see. Awesome thanks.
Post by Jon Ogden
Make the weapon a total size of 32x32 but with transparent pixels
around the size of the weapon you want. Then when it hits a wall,
just don't count it as a hit until the actual weapon hits the wall
(don't count the blank pixels).
Sent from my iPhone
_______________________________________________
Unsubscribe by sending a message to:
<nug-***@lists.xojo.com>

List Help: <***@xojo.com>

Continue reading on narkive:
Loading...