Slick Forums

Discuss the Slick 2D Library
It is currently Tue May 21, 2013 5:57 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Jun 19, 2012 3:51 pm 
Offline

Joined: Sun Jun 17, 2012 6:17 pm
Posts: 4
I was wondering on what the best way would be to prevent my player from 'going' into restricted areas, e.g. walls, barrels, cars etc.
I've had trouble by doing it pixel by pixel since the player's position is calculated from the images top left, so the rest of the players body can still enter these areas visually.
Any help is appreciated.


Top
 Profile  
 
PostPosted: Wed Jun 20, 2012 6:40 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
you can check collision using a collision box

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
PostPosted: Wed Jun 20, 2012 5:21 pm 
Offline

Joined: Sun Jun 17, 2012 6:17 pm
Posts: 4
The problem with your idea is that the items such as walls and boxes aren't drawn into the game separately from the background, will I have to draw them separately and use collision boxes or is there another way I can achieve this.


Top
 Profile  
 
PostPosted: Thu Jun 21, 2012 7:47 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1313
Location: Italy
sorry but why walls aren't separated from background?
Background is something on a layer where player can't interact with it, enemies, walls and so on are in another layer

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], Hardcore and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group