Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

A Turtle Adventure

What am I Learning today?

I am learning how to use variable assignment in python
I am learning how to change variable values and types

Knowledge Organiser

×

Lesson

Task 1 - Starting our Adventure Click to see more

Today we are going to create a character sheet for our Fantasy Turtle Text Adventure



Lets try the following tasks:

Tick each task when you have successfully done it in the following list:

Complete the following tasks

Create a New python file call it 'My_Text_Adventure'


Task 2 - Character Sheet template Click to see more

Task 1: Creating the Layout with Rectangles

Objective: Use Turtle graphics to draw a bordered layout and a character portrait placeholder.

Instructions:

  • Draw a large rectangle that will serve as the border for the character sheet.
  • Create a smaller rectangle inside the border to represent the character portrait area.

Guidance:

  • Ensure that you practice positioning the Turtle correctly using penup(), pendown(), and goto() to move it around the screen.
  • Use loops and the forward() and right() methods to draw the rectangles.

Expected Output: A screen with a bordered layout and a smaller rectangle labeled “Portrait”.


Try and recreate this basic Character Sheet if you can't do it on your own yet the code for it is below the picture

Code



Task 3 - Adding Character Information Click to see more

Task 2: Adding Character Information (Race and Class)

Objective: Add static text to display the Sheet Title and the character's race and class within the layout.

Instructions:

  1. Position the Turtle to write "Epic Text Adventure Character Sheet" on the character sheet.
  2. Position the Turtle to write "Race: Elf" and "Class: Ranger" on the character sheet.

Guidance:

  • Practice using write() to display text and adjust the position with goto().

Try and recreate this additional Character Sheet information if you can't do it on your own yet the code for it is below the picture

Code

Here is the additional code you might need, you can use the line numbers to help you add this code in the correct place in your file



Task 4 - Generating Randomized Stats Click to see more

Task 3: Generating Randomized Stats

Objective: Use the random library to create randomized stats for the character and display them on the sheet.

Instructions:

  • Import the random library and modify the code so each character stat is randomly generated.
  • Ensure that each stat value is between 8 and 18.

Guidance:

  • Use random.randint(8, 18) to generate random values for each stat.

Expected Output: A complete character sheet with the border, portrait, character info, and randomized stats.

Code

Here is the additional code you might need, you can use the line numbers to help you add this code in the correct place in your file



Task 5 - What are we aiming for? Click to see more

Task 4: Final Character Sheet

Next lesson we will be creating an image and adding it to our character sheet as well as making the whole thing more colourful and interesting.


Summing it all up

Lets look at the learning outcomes and decide which one best describes our current level of understanding :

Tick the one you feel is closest to your level

Learning Outcomes I need to learn how to change variable values and types

  • I have a basic understanding of how I can change variable values and types with a little help from my teacher
  • I can show my teacher that I can change variable values and types without their help.
  • I can change variable values and types independently and I can also explain it to others and can complete any extension tasks I am given.

🠜 Now update your learning objectivesClick on the Assessment image



My Notes: Text_Programming

Student_Comment_2 not found

Task Notes/Comments - Add here Click to see more

Comments/Notes