game movement - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: game movement (/thread-3023.html) |
game movement - Diroga - 01-19-2004 it's off by one or something so it dosnt cover up all the movement. what i dont get is that it works for moving a pixle around but it wont work for this. Code: SCREEN 12 game movement - Zack - 01-19-2004 Code: IF LCASE$(press$)="d" THEN [edit] Just thought I should explain why... Since x and y were once used - to load the map. So they aren't holding the postition of the @ - so you're LOCATEing the wrong position completely. Common typo-error. game movement - Diroga - 01-19-2004 Blarg...It's always those with me. Thanks. if you cant tell Iâm working on the rouge game. I havenât figured out the part when you walk down a hallway and all you see is a few steps ahead of you. I was thinking of making a big bitmap and reading it but having some way of restricting how much is displayed. Suggestions? game movement - Zack - 01-19-2004 I'm not sure what you mean...Afee steps? Huh? game movement - Diroga - 01-20-2004 Ok more to it now: I know I can use a$ = string$(number_of_spaces,character) for text boxes and stats. What else needs fixing? About the movement: in the game I want the player to only see areas that have light or have already been explored, so the lower half of the map you would not see untill you go there. game movement - Agamemnus - 01-20-2004 Dirgoa, proofread your messages! I didn't understand a word of the last one! Quote:Ok more to it now: I know I can use a$=string$(#spc,chr) [huh?]. What else needs fixing? About the movement: in the game I want the player to only see areas that have light or have already been explored, so the lower half of the map you would not see untill you go there. Ok, so for this implementation of explored areas and visible areas, you need an explored areas array as big as the map itself and a visibility formula. Common visibility formula: Anything in a certain radius of the observer where no walls block the observer.. simply use bresenham formula in circles. You have a lot of work to do.. game movement - Diroga - 01-20-2004 bresenham formula? this sounds bad. game movement - Agamemnus - 01-20-2004 Bresenham = line formula. What you want to do is trace paths (line) from all points on the circumference of your "circle" to your player (who would be in the center of the circle), and Bresenham allows you to do that. Search for it. In this case, it would mater A LOT from what point you start (center of circumference point): you keep everything visible until you hit a wall or until you get to the maximum visibility radius. Also you'll need a formula to get all the points in your circle's circumference.. (radius is again the maximum visibility radius) game movement - SCM - 01-21-2004 You could also use a rectangle. it is much easier to compute. Code: FOR x = xPlayer - xVisibility TO xPlayer + xVisibility If you want to be able to return to a room and be able to see what you've aready explored then you should have an explored areas array for each room, as Aga suggessted. If you don't care about that and each room fits on the screen, You can just update the screen each time you move. game movement - Agamemnus - 01-21-2004 That rectangle code won't work because you don't take walls into account. |