Online users ( Unknown) |
Application object not working properly at the moment, no clue who is online... * Numbers in parentheses are the number of minutes since the user last loaded a page. Logged-in users time out after 40 minutes (unless they manually log out), lurkers and anonymous posters after 20. |
Go to page 1 2 |
Apocalyptic Registered user Apocalypse of time Last page view: 7170 days, 1 hour, 28 minutes and 3 seconds ago. |
The maxnoofrooms is set at 20 before the loop so it'll keep doing the loop until maxnoofrooms equals 0. Let the reaper come for me for when he does I shall make him play ADOM and he'll forget about me due to being addicted. |
||
Apocalyptic Registered user Apocalypse of time Last page view: 7170 days, 1 hour, 28 minutes and 3 seconds ago. |
I'm going to half to throw that attempt out anyway and start on a new one. It locks up when I run it. I don't know why it's doing that but it has to be in the programming. I don't have any problem with it though since I learned a lot from this attempt. Let the reaper come for me for when he does I shall make him play ADOM and he'll forget about me due to being addicted. |
||
Twinge Registered user Communist in Disguise Last page view: 5515 days, 2 hours, 38 minutes and 30 seconds ago. |
you might want to use a for/next loop instead of a Do loop if you're going to have a regular increment/decrement in the loop. For example... For MaxRooms 20 to 0 Step -1 (Code) Next MaxRooms |
||
Apocalyptic Registered user Apocalypse of time Last page view: 7170 days, 1 hour, 28 minutes and 3 seconds ago. |
I hadn't thought of doing it that way but it will probably work out better. Thanks for the tip. Let the reaper come for me for when he does I shall make him play ADOM and he'll forget about me due to being addicted. |
||
Apocalyptic Registered user Apocalypse of time Last page view: 7170 days, 1 hour, 28 minutes and 3 seconds ago. |
I finally got the dungeon generator working. Yes I've got random dungeons finally. Now I just have to make it so that the character can move on the screen. I figured I'd do that in the keypress event but it's not working out. Oh well back to work. Let the reaper come for me for when he does I shall make him play ADOM and he'll forget about me due to being addicted. |
||
Apocalyptic Registered user Apocalypse of time Last page view: 7170 days, 1 hour, 28 minutes and 3 seconds ago. |
The next problem I've ran into is moving the character across the screen. It's not working out to well and any help is appreciated. For now I'm going to take a brake from the programming and do some research. Let the reaper come for me for when he does I shall make him play ADOM and he'll forget about me due to being addicted. |
||
JCool14 Unregistered user |
Ok, I'm sorry if this has been pointed out (I got tired of reading). You're going to have a lot of trouble doing this in VB. It helps to have something more OO, such as C++ or Java. But, if you must continue, storing values for x and y is easy. I'm pretty sure you can make your own types (TYPE PlayerType) and put in variables such as these: DIM px,py,opx,opy AS INTEGER I haven't used VB in a while so you'll have to change this to your situation. Now when a character moves, first save the value at px (player x) into opx (old player x) and the same for py. Then update px and py to whatever the player inputed (like if he/she pressed up, then py = py - 1) and check if that is a valid square, if it is, then move there. If it isn't, then change the px and py to their old cooridanates. Also for the map, use a multi-dimensional array to store the type of square for each coor. on the map. Make sense? |
||
JCool14 Unregistered user |
Oh, sorry, I notice now you got that worked out. Well, good luck. I'll try to think of something for your current problem. |
||
JCool14 Registered user Last page view: 6836 days, 18 hours, 3 minutes and 39 seconds ago. |
Alright, what you need is a game loop. A WHILE gameQ = False loop. The gameQ variable is the boolean that says wether or not to quit the game. Simple enough. Now, every turn, check to see what the last button pressed by the user was, such as arrow keys, or maybe an attack button, your choice. The store that value in another variable. Here could be some tidbits of code you might use(again, I haven't used VB in a while now, so bare with me) WHILE gameQ = FALSE SELECT CASE Inkey$ Case 1: keyPressed = UP Case 2: keyPressed = LEFT Case 3: keyPressed = RIGHT ... Case 20: keyPressed = Q ... END SELECT doAction (keyPressed) LOOP Something like that. By the way, you'll have to replace the case numbers with the appropriate letter, or chr$(###), the ### being the ASCII character key. Hope this helps. [Edited 1 time, last edit on 4/5/2005 at 14:41 (GMT -5) by JCool14] |
||
demented_yam Registered user yaaarrrrrghhhh! Last page view: 7262 days, 19 hours, 26 minutes and 32 seconds ago. |
"Ok, I'm sorry if this has been pointed out (I got tired of reading). You're going to have a lot of trouble doing this in VB. It helps to have something more OO, such as C++ or Java" i don't think it really needs to be object oriented for this. hell, pascal isn't and i'm doing fine with mine |
||
JCool14 Registered user Last page view: 6836 days, 18 hours, 3 minutes and 39 seconds ago. |
I said it'd be "helpfull". Doesn't mean it has to be. Heck, I was doing one in Qbasic. |
||
tongHoAnh Unregistered user |
I'm doing one on Java. Actually, Java (and C) is the only language I can make anything proper out of it. I didnt tackle with map generator yet, my design simply put a question mark on that section. The question is, how to make corridors? |
||
tongHoAnh Unregistered user |
btw, I highly recommend u guys subcribing to rogulike development newsgroup. The frequently pop up neat solutions. |
Go to page 1 2 |