This site requires JavaScript, please enable it in your browser!
Greenfoot back
kdworczyk
kdworczyk wrote ...

2015/10/7

How to check if the player is touching a certain image?

kdworczyk kdworczyk

2015/10/7

#
So I create my world with
getBackground().drawImage(floorTile, 64*j, 64*i);
where floorTile is a variable with an image assigned to it. How can I check for example if a player is tsabnding on a certain image or is next to once so he can;t walk through walls?
davmac davmac

2015/10/7

#
You can't easily do that - it is better to use actors to represent tiles that block the player's movement.
kdworczyk kdworczyk

2015/10/7

#
yeah I realized that now and changed it which turned out to be surprisingly easy. Cheers for the asnwer
You need to login to post a reply.