logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

var x and y to be shared in multiple functions

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 

import random

import time

global x

global y

x = 1

y = 1

 

def gameIntro():

print("R e t i n a l S i")

print(" copyright 2022  ")

time.sleep(2)

print("D u n g e o n  o f  F e a r")

print("      by RetinalSi         ")

print()

def mapLoad():

if x == 1 and y == 1:

print("|------------|")

print("|         |")

print("|     0/      ")

print("|    oH      ")

print("|         |")

print("|------------|")

elif x == 2 and y == 1:

print("|------------|")

print("|         |")

print("   0/ \M      ")

print("  oH   Ho     ")

print("|         |")

print("|------------|") 

elif x == 3 and y == 1:

print("|------------|")

print("|         |")

print("   0/   M    |")

print("  oH  \(H)/  |")

print("|         |")

print("|----    ----|")

elif x == 3 and y == -1:

print("|----    ----|")

print("|         |")

print("|   0/        ")

print("|  oH ,;OOOoo ")

print("|         |")

print("|------------|")

elif x == 4 and y == -1:

print("|----    ----|")

print("|         |")

print("   0/        |")

print("  oH  s(o)s  |")

print("|         |")

print("|------------|")

elif x == 4 and y == 1:

print("|------------|")

print("|         |")

print("|   0/    Oi  ")

print("|  oH     H|  ")

print("|         |")

print("|----    ----|")

elif x == 5 and y == 1:

print("|------------|")

print("|         |")

print("   0/   _    |")

print("  oH   |=|   |")

print("|         |")

print("|------------|")

else:

print("No door there...")

 

def movePlayer():

print("W, A, S, D, to move...")

pmove = input()

if pmove == 'w':

y = y + 1

elif pmove == 'a':

x = x - 1

elif pmove == 's':

y = y - 1

elif pmove == 'd':

x = x + 1

else:

print("invalid entry.")

 

gameIntro()

gameRun = 'yes'

while gameRun == 'yes':

mapLoad()

movePlayer()

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

577 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

605 Answers

Hire Me
expert
Husnain SaeedComputer science

814 Answers

Hire Me
expert
Atharva PatilComputer science

926 Answers

Hire Me