Pseudo Code
Main Overlook Pseudo Code
BEGIN(Main) Rpg Game:
BEGIN Menu
END Menu
WHILE Health > 0:
BEGIN movement
IF Health < 0 :
END WHILE
INPUT: " Game Over you Died, Play Again?"
IF input is "yes"
BEGIN Menu
ELSE:
END (Main) Rpg Game
Menu Code
BEGIN Menu:
PRINT logo
INPUT "what do you wish to choose?"
CASEWHERE:
1 : "start", BEGIN movement
2 : " Instructions" , BEGIN HelpMe
3 : "exit" , END Menu
4: "map", BEGIN Map
END CASEWHERE
END Menu
Movement Code:
BEGIN Movement :
WHILE Health > 0:
BEGIN Show Status
INPUT "What will you do?"
CASEWHERE:
Go North : Move North IF room is to the south
Go South : Move south IF room is to the south
Go East : Move East IF room is to the south
Go West : Move West IF room is to the south
Get : BEGIN Get
Talk : BEGIN Talk
Map : BEGIN Map
helpme : BEGIN HelpMe
Use : BEGIN Use
Inv : BEGIN Inv
END CASEWHERE
IF Health < 0
END WHILE
END Movement
HelpMe Code:
BEGIN HelpMe
PRINT the game commands
INPUT "Continue?"
END HelpMe
Map Code:
BEGIN MAP
PRINT the visual representation of the map
END MAP
Get Code:
BEGIN Get
INPUT the item you want to get
IF item is in room:
Add the item to your inventory
Delete the item from room
ELSE:
PRINT "Item not in room"
END GET
Use Code:
BEGIN Use:
INPUT the item you want to use
IF item is in inventory:
use the item if it can be used
ELSE:
PRINT " Item is not in Inventory"
END Use
Inv Code
BEGIN Inv:
PRINT the inventory
END inv
Show Status code:
BEGIN Show Status:
PRINT Health
PRINT the room you are in
PRINT information about room
IF enemy is in the room :
BEGIN Battle
ELSE:
PRINT "what shall you do?"
END Show Status
Battle code:
BEGIN Battle:
PRINT "you are under attack by the enemy , what shall you do?"
WHILE enemy's Health > 0
INPUT " Hit or Heal?"
IF INPUT is hit:
Make a random number (to find out if you hit or not)
IF you get a number which allows you to hit
Make another random number which shall be your attack
Remove your attack from enemy's health
PRINT " You did (attack) number of damage"
ELSE:
PRINT "You Miss"
ELIF INPUT is Heal:
generate a random number which shall be heal
Add Heal to your Health
ELIF: Your Health < 0
INPUT: " Game Over you Died, Play Again?"
IF input is "yes"
BEGIN Menu
ELSE:
END Battle
ELSE:
PRINT "Invalid input"
Make a random number (to find out if the enemy hits or not
IF you get a number which allows you to hit
Make another random number which shall be the enemy's attack
Remove the enemy's attack from your health
END Battle
BEGIN(Main) Rpg Game:
BEGIN Menu
END Menu
WHILE Health > 0:
BEGIN movement
IF Health < 0 :
END WHILE
INPUT: " Game Over you Died, Play Again?"
IF input is "yes"
BEGIN Menu
ELSE:
END (Main) Rpg Game
Menu Code
BEGIN Menu:
PRINT logo
INPUT "what do you wish to choose?"
CASEWHERE:
1 : "start", BEGIN movement
2 : " Instructions" , BEGIN HelpMe
3 : "exit" , END Menu
4: "map", BEGIN Map
END CASEWHERE
END Menu
Movement Code:
BEGIN Movement :
WHILE Health > 0:
BEGIN Show Status
INPUT "What will you do?"
CASEWHERE:
Go North : Move North IF room is to the south
Go South : Move south IF room is to the south
Go East : Move East IF room is to the south
Go West : Move West IF room is to the south
Get : BEGIN Get
Talk : BEGIN Talk
Map : BEGIN Map
helpme : BEGIN HelpMe
Use : BEGIN Use
Inv : BEGIN Inv
END CASEWHERE
IF Health < 0
END WHILE
END Movement
HelpMe Code:
BEGIN HelpMe
PRINT the game commands
INPUT "Continue?"
END HelpMe
Map Code:
BEGIN MAP
PRINT the visual representation of the map
END MAP
Get Code:
BEGIN Get
INPUT the item you want to get
IF item is in room:
Add the item to your inventory
Delete the item from room
ELSE:
PRINT "Item not in room"
END GET
Use Code:
BEGIN Use:
INPUT the item you want to use
IF item is in inventory:
use the item if it can be used
ELSE:
PRINT " Item is not in Inventory"
END Use
Inv Code
BEGIN Inv:
PRINT the inventory
END inv
Show Status code:
BEGIN Show Status:
PRINT Health
PRINT the room you are in
PRINT information about room
IF enemy is in the room :
BEGIN Battle
ELSE:
PRINT "what shall you do?"
END Show Status
Battle code:
BEGIN Battle:
PRINT "you are under attack by the enemy , what shall you do?"
WHILE enemy's Health > 0
INPUT " Hit or Heal?"
IF INPUT is hit:
Make a random number (to find out if you hit or not)
IF you get a number which allows you to hit
Make another random number which shall be your attack
Remove your attack from enemy's health
PRINT " You did (attack) number of damage"
ELSE:
PRINT "You Miss"
ELIF INPUT is Heal:
generate a random number which shall be heal
Add Heal to your Health
ELIF: Your Health < 0
INPUT: " Game Over you Died, Play Again?"
IF input is "yes"
BEGIN Menu
ELSE:
END Battle
ELSE:
PRINT "Invalid input"
Make a random number (to find out if the enemy hits or not
IF you get a number which allows you to hit
Make another random number which shall be the enemy's attack
Remove the enemy's attack from your health
END Battle