light site-logo
  • Home
  • About us
  • Courses
  • English
    • Ελληνικά
Login
  • Home
  • About us
  • Courses
  • Login
  • Contact Us
  • English
  • Ελληνικά
Home Programming and Creating Games Points and Other Information in our Games
Programming and Creating Games
366 / 366 Days
Design Elements of an Electronic Game
Yet to Start
  • Quiz - Design Elements of an Electronic Game
Electronic Games and Coding
Yet to Start
  • Quiz - Electronic Games and Coding
Scratch in Action
Yet to Start
  • Quiz - Scratch in Action
Activity
Yet to Start
  • Crossword
The Heroes Positions in the Stage
Yet to Start
  • Activity - Game
  • Quiz - The Heroes Positions in the Stage
Points and Other Information in our Games
Yet to Start
  • Points and Other Information in our Games - Exercises
  • Quiz - Points and Other Information in our Games
Write in the scene
Yet to Start
  • Write in the scene - Exercises
  • Quiz - Write in the scene
Actions only if something happens
Yet to Start
  • Actions only if something happens - Exercises
  • Quiz - Actions only if something happens
Perform actions multiple times
Yet to Start
  • Perform actions multiple times - Exercises
  • Quiz - Perform actions multiple times
Events and Sprite Communication
Yet to Start
  • Events and Sprite Communication - Exercises
  • Quiz - Events and Sprite Communication
Banana Chase (The Game)
Yet to Start
The Game - Presentation of Details
Yet to Start
  • Quiz - The Game - Presentation of Details
Sprite Movement With Mouse
Yet to Start
  • Sprite Movement With Mouse - Exercises
  • Quiz - Sprite Movement With Mouse
Automatic Random Motion of an Enemy Character
Yet to Start
  • Quiz – Automatic Random Motion of an Enemy Character
How Our Hero Will Lose
Yet to Start
  • How Our Hero Will Lose - Exercises (Create a Game)
  • Quiz - How Our Hero Will Lose
The Enemy Character Following the Hero
Yet to Start
  • Quiz - The Enemy Character Following the Hero
Show Enemy Character at Random Position
Yet to Start
  • Show Enemy Character at Random Position - Exercises
  • Quiz - Show Enemy Character at Random Position
The Game Gets Difficult as Time Passes
Yet to Start
  • Quiz - The Game Gets Difficult as Time Passes
Scratch Millionaire Game
Yet to Start
Grab The Bone (The Game)
Yet to Start
« ‹ › » page 1 / 2

Progress Bar

Programming and Creating Games

Points and Other Information in our Games

Video - Points and Other Information in our Games

  • Scratch 3
  • Scratch 2

Video Transcript

Hello

In this lesson, Stevie will talk about the “variables”.

Variables are a programming concept that is used in all programming languages.

Understanding the meaning and usefulness of variables is essential to the progress of these courses.

Watch this video more than once, freeze the picture wherever you need to read the texts more carefully and of course try the presenter's suggestions in your Scatch window.

Have fun.

 

Good evening!

In most computer games, the leading heroes collect points.

Suppose we create a game where a monkey is seeking bananas to eat.

But it must avoid the lions who are hunting to eat the monkey.

Every time the monkey eats bananas it earns points.

Let's see a few snapshots of such a game ...

You see how the score value changes whenever the monkey achieves its goal.

That is to eat a bunch of bananas.

The score is a variable. It is named so because the value it contains can vary during the execution of a program.

We can imagine the score as a box in our computer that at any moment may contain a different value. This value can change in a number of ways.

The programmer may set to decrease it when something occurs (for example, when the lion touches the monkey) or increase it in another case, as the programmer invents using his imagination.

Because the programmer can’t know at any moment the value he has in that box, as it can change in many ways, when he wants to use this value instead of the number he uses the box name.

Each time the programmer uses the word “score”, he chooses the number he has inside, whatever this number is.

Let's look at the game for a few seconds but from another perspective.

So we have five sprites. The bananas, the monkey and the 3 lions.

If we click on the lions to see the script assigned to each one,we will notice that each of them has a different script that allows him to have a different behavior in the game.

Let's see this in practice.

Note how the speed of lions varies.

One goes very slowly, the other a little faster and the third even faster.

If you become a little more careful you will see how the speed of one of the lions grows as the score rises.

Let's now look at the code, the way the variable score is used.

In the banana scenario, you see how the original score value is set to 0.

So every time a new game starts, the score will start from the beginning.

The following lines contain codes that will be discussed in more details in one of the following lessons of this section.

Now we can say that these lines set the number containing in the variable score changes by +1 every time the banana touches the monkey.

That is, if the variable score contains the number 0, once the banana touches the monkey - it will become 1,if it happens again, it will become 2 and will continue to increase in this way.

In the 1st and 3rd lion the variable score is not used at all.

But the second lion is the one that changes its speed according to the score.

With these lines we can achieve this result.

You see how the programmer adjusts the lion's movement according to the value of the variable score.

Note how the variable score is used. With the instruction

Move (score / 4) steps, the programmer, of course, instructs the object to move as many steps as contained within the variable score divided by 4.

As the score value increases with the evolution of the game, the lion's movement will be greater.

 

Topics

Points and Other Information in our Games - Exercises

Quizzes

Quiz - Points and Other Information in our Games

← Previous Lesson Next Lesson →

Search in our Page

 

Get in Touch

Facebook Twiter Linkedin

Terms of Use and Privacy Policy

Privacy Policy

Terms and Conditions

Cookie Policy

Support Tickets System:

Support Tickets System

  • [email protected]
  • [email protected]
Copyright 2020 - Coyotelearner STEM Academy All Rights Reserved
Cookies on Coyotelearner STEM Academy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies. Read our cookie policy
here
Cookie settingsACCEPT
Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

SAVE & ACCEPT
  • Ελληνικά (Greek)
  • English