You could use colour sensing. Make the sprite have a different colour on each side of it, then put this script:
When green flag clicked
Forever
If [colour of right side of sprite] is touching colour [wall colour] or [colour of left side of sprite] is touching colour [wall colour]
Set 'X velocity' to ('X velocity'*-1)
End if
If [colour of top of sprite] is touching [wall colour]
Set 'Y velocity' to ('Y velocity*-1)
End if
If [colour of bottom of sprite] is touching [wall colour]
If key up arrow pressed
Set 'Y velocity to (how high you want the sprite to jump)
Else
Set 'Y velocity' to 1
Else
Change 'Y velocity' by -1
End if/else
End forever
I know this isn't that easy to understand, but I hope you get it!
Offline
Also, if you want your sprite to be just one colour, you can make a sprite called 'Sensor' almost exactly the same size as the sprite but one pixel wider in each direction and put the different colours on there. Then make it invisible by putting this on it:
When green flag clicked
Set 'ghost effect' to (100)
Then put the script I said in my previous post on the sensor, and then all you have to do is put this on the visible sprite:
When green flag clicked
Forever
Go to 'Sensor'
End forever
My game 'Scrolling Maze Game uses a 'Sensor' sprite, so if you're stuck you can download it from here, and look at the scripts.
Offline