by skydereign » Sat May 30, 2009 4:05 am
Yes, all the references to 60 would be switched to 10. You might as well #define that, or use the width of your tile. My computer is broken right now, essentially the graphics don't work, and so I can't look into the draw code right now, but I can explain what I think I did. The main idea behind it, I don't like using keydown events, I tend to do everything in draw... so you could split it us, because all it does is check the spot you are moving to. So instead, use just say, keydown right. In this, it will have a switch statement, using the tile array with the coordinates of x+1, y, the subs. If it is 0, case 0, then move there and adjust the array you are on. What it is doing for that is setting the xy you are on to 0 and moving your xy right one. If there is a wall, case 1, then do nothing. If there is a rock, case 2, move the rock and move the actor. This is the general idea of the draw, if I can get my computer working, I could make a commented demo, not using the draw script for it. That is if this explanation did not help.