Presentation is loading. Please wait.

Presentation is loading. Please wait.

World of Wokcraft The very best in Single pan cooking themed fantasy gaming!

Similar presentations


Presentation on theme: "World of Wokcraft The very best in Single pan cooking themed fantasy gaming!"— Presentation transcript:

1 World of Wokcraft The very best in Single pan cooking themed fantasy gaming!

2 Characters Ninja Skills & Features

3 Characters Yakuza Skills & Features

4 Characters Butcher Skills & Features

5 Characters Cleaver Skills & Features

6 Characters Dragon Skills & Features

7 Stage 1 – some basics. Let’s look at some of the key ideas and structures needed.

8 Program structure. The program will consist of a main loop that controls everything that goes on. This is a very common structure so you should get to know how it works. The main loop makes some key decisions about what is supposed to be happening, and calls an appropriate function to carry out the work needed. This means that the main loop is not very complicated. Each specific task will be carried out by a function. Each of the characters in the game will be represented by a list. The list for each character will contain a name, character type and skill level.

9 Main Loop The main loop will be a loop that asks the user to input a choice. This will be one of; Name Skill Type Print Combat Stop Depending on the input, the loop will Then ask for either a name, skill level, or character number and then call the appropriate function with the appropriate data. The loop will be a continuous loop and will constantly ask the user for the next input until the word ‘stop’ is typed, at which point the loop will exit & the program will stop.

10 List structure (phase 1) The list for each character will contain; Position 0 Name Position 1Character Type Position 2Skill level

11 Game functions. This game initially will be able to do the following things; Set / change the name for each character Set / change the skill level for each character Set / change the character type for each character. Print the details of a specified character. (stage 2 of game will set characters as elements in a list, with corresponding entries in lists for types, skill levels etc …. Could also be a list within a list)

12 Game functions #2 Apart from the Combat function, each function will have to ask the user to specify which character it is supposed to be working on – e.g. If the Name option has been specified in the loop, then the NameCharacter function is called, which will then ask the user to specify whether it is Character 1 or Character 2 that they are naming. The appropriate character name will then be changed.

13 Stage 2 – Build the code to create the players.. First task is to create the players.

14 Step 1 – Basic structure. Create a new program. Call it WorldofWokcraft Create some comment lines to describe the first few sections of the code; Declare variables Create functions Main Loop Save the code as WorldofWokcraft_001

15 Name Character Define a function called NameCharacter, which has a single parameter as its input. This will be a string to contain the name of the character. For now all the code does is print the name given to it. Save the code as WorldofWokcraft_002

16 SetTypeCharacter Define a function called SettypeCharacter, which has a single parameter as its input. This will be a string to contain the type of the character. For now all the code does is print the name given to it. Save the code as WorldofWokcraft_002b

17 Set Skill Character Define a function called Setskillcharacter, which has a single parameter as its input. This will be an integer to contain the skill level of the character. For now all the code does is print the number given to it. Save the code as WorldofWokcraft_003

18 Print Character Define a function called PrintCharacter, which has no parameters as its input. For now all the code does is print “Print Character ”. Save the code as WorldofWokcraft_004

19 Combat Define a function called Combat. As yet this function has not been designed. For now all it does is print the word “Combat”. Save the code as WorldofWokcraft_005

20 Step 2 – Main Loop. Note – you will be creating variables as you go through this – make sure that when you need / use a variable, you add it to the variable declaration section at the beginning of the program. Give every variable a default value. Use comments to explain what is happening in the code – you can do this before you add code to give you an ‘english’ explanation of the logic. This kind of design is called ‘Pseudo Code’.

21 Main Loop #2 Create a loop that repeats until a value of ‘stop’ is typed. Ask the user for input each time round the loop. Depending on the value given, ask the user for the value of appropriate piece of data that is to be set; e.g. if Name has been given, then ask the user for the name to be used. call the appropriate function that you have already coded passing the value across. Test your program. Save the code as WorldofWokcraft_006

22 Step 3 – Functions – add logic.

23 NameCharacter. In the NameCharacter function; Ask the user for the character they want to set (1 or 2). Set Item 0 (Name) of the appropriate character list to the name specified as the parameter to the function. Print a summary of what has just happened Save the code as WorldofWokcraft_007

24 Set Skill Character. In the SetskillCharacter function; Ask the user for the character they want to set (1 or 2). Set Item 2 (Skill) of the appropriate character list to the number specified as the parameter to the function. Print a summary of what has just happened Save the code as WorldofWokcraft_008

25 Print Character. In the PrintCharacter function; Ask the user for the character they want to set (1 or 2). Use a loop to cycle through the list for that character printing out a summary of the character – make sure appropriate titles are printed along side the data. Save the code as WorlofWokcraft_010

26 Step 4 - Validation You now need to add code that prevents the user from inputting incorrect data. This as called VALIDATION. The validation rules are; Character nameAnything Character typeNinja,Yakuza,buther,cleaver,dragon Skill 0-10 Main loop choiceName,Skill,Type,Print,Combat,Stop You will need to add some code that checks the data input by the user & gets them to re-try if it’s incorrect.

27 This is an undefined function that you will have to specify and write yourselves. Step 5 – Combat.


Download ppt "World of Wokcraft The very best in Single pan cooking themed fantasy gaming!"

Similar presentations


Ads by Google