Table of Contents

think()

Function Definition: think(message = "Hello!", time)

Parameters

NameTypeDescriptionExpected ValuesDefault Value
messagestringThe text you want to write.String"Hello!"
timeintTime for which the message is displayed. If value is 0 then the sprite will say until another speech or thought block is activated, or the stop sign is pressed.Integer0

Description

The function gives its sprite a thought bubble with the specified text, which stays for the specified amount of seconds.

If the value of time is 0 then, the thought bubble stays until a speech or thought block with its text block empty is activated, or the stop sign is pressed.

Example

The example demonstrates how to use say and think of sprite in a project.

Code

sprite = Sprite('Tobi')
import time

sprite.say("Saying for 2 seconds", 2)
sprite.say("Saying forever")
time.sleep(2)

sprite.think("Thinking for 2 seconds", 2)
sprite.think("Thinking forever")

Output

Read More
All articles loaded
No more articles to load