View Single Post
  #2  
Old 03-31-2001, 09:06 PM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
You could change your movement things so they look like this:
NPC Code:

if (keydown(1)&&!onwall(playerx,playery+1.5) {
playerx-=0.5;
playerdir = 1;
}



the playerx, and playery+1.5 are the co-ordinates where it looks to see if its onwall, do same for other directions, changing the co-ordinates of the onwall for each... or you can add something like this:
NPC Code:

if (keydown(1)&&onwall(playerx,playery+1.5) {
playerx+=0.3;
playerdir = 1;
}


this'll just bounce him back if in the wall, but youll have to have the original movement script as well.

Reply With Quote