psuedo code idea

ARC

Well-known member
Joined
Sep 9, 2006
Messages
63
Location
Minnesota
Programming Experience
Beginner
I've already written this in actual code, but it's not organized well enough (I dont think)... And parts of it still dont work. Before I get into that though, I was wondering if someone would comment on whether or not this looks like the right way to do the things I wanna have it do.

User types into a textbox called userinput.text
User sees all responses and such in maintext.text
the "dragon" is controled by a timer event which fires every 8 seconds.
you have five commands at your disposal as the player.
1. Fight
2. Run away
3. Move to another room
4. Enter the cave (to begin the game)
5. Rules (displays the rules of the game)

If there are any question to how the game is supposed to work, I can explain in more detail, but it should be fairly explanitory through the psuedo code. I'm just looking for suggestions on if im using "not the most logical" approach to achieving the tasks. THanks!


VB.NET:
On Load
Dragon State = Random (1-3)
Dragon Location = Random (1-16)
Your Location = 0
 
On Click (or Enter Key)
            Grab User Input Text
                        Select Case User Input Text
                                    Case Rules
                                                Display Rules
                                    Case Restart
                                                “Game Over”
                                                Disable Dragon Timer
                                                Set your Location to 0
                                    Case Enter
                                                “You have entered the cave, into Room 1”
                                                Enable Dragon Timer
                                                Set Your Location to 1
                                    Case 1
                                                If Your Location = 0
                                                            “You need to enter the cave first”
                                                If Your Location > 0
                                                            If Your Location = 1
                                                                        “You’re already in Room 1”
 
                                                “You have joined Room 1” 
 
Case 2
                                                If Your Location = 0
                                                            “You need to enter the cave first”
                                                If Your Location > 0
                                                            If Your Location = 2
                                                                        “You’re already in Room 2”
 
                                                “You have joined Room 2”
 
                                    Case 3…
                                    Case 4…
                                    Case 16…
 
 
Case Fight
                                                If Your Location = Dragon Location
 
                                                            If Dragon State = 1
                                                                        “He over powers you, you lose”
                                                                        Set Your Location = 0
                                                                        Disable Dragon Timer
                                                            If Dragon State = 2
                                                                        “You over power him, you win”
                                                                        Set Your Location = 0
                                                                        Disable Dragon Timer
                                                            If Dragon State = 3
                                                                        “You sneak up on him, you win”
                                                                        Set Your Location = 0
                                                                        Disable Dragon Timer
                                                Else
 
                                                            “There’s nothing to fight in this room”
 
 
Case Runaway
            “You’re a chicken”
            Set Your Location = 0
            Disable Dragon Timer 
 
 
Else
            “That isn’t a real command”
 
 
If Your Location = Dragon Location
 
Check Dragon State
                        If Dragon State = 1
                                    “Game Over”
                                    Disable Dragon Timer
                                    Set Your Location to 0
 
                        If Dragon State = 2
                                    “You See Dragon Standing There”
 
                        If Dragon State = 3
                                    “You See Sleeping Dragon”
 
Dragon Timer Event
 
Dim State as Integer
Dim Room as Integer
Dim Random as New Random
 
States = Random (1-3)
Room = Random (1-16)          
 
If Your Location = Dragon Location
 
Check Dragon State
                        If Dragon State = 1
                                    “Game Over”
                                    Disable Dragon Timer
                                    Set Your Location to 0
 
                        If Dragon State = 2
                                    “You See Dragon Standing There”
 
                        If Dragon State = 3
                                    “A dragon walks into your room and falls asleep on a rock”
 
woah, sorry... I wrote this up in word first, and appearently the format copy+paste is screwy between the two.
 
Back
Top