#Need Help to "Tell A Story" in CodeHs

4 messages · Page 1 of 1 (latest)

velvet coyote
#

I know it's extremely simple code to most of you guys but I suck at it :(. Basically I need to create a 4 page scene using simple python code and algorithims. Here's the outline.

"""
Draws the first scene on the canvas and outputs the first
section of text for the story.
"""
def draw_scene1():
print("This is scene 1")

"""
Draws the second scene on the canvas and outputs the second
section of text for the story.
"""
def draw_scene2():
print("This is scene 2")

"""
Draws the third scene on the canvas and outputs the second
section of text for the story.
"""
def draw_scene3():
print("This is scene 3")

"""
Draws the fourth scene on the canvas and outputs the second
section of text for the story.
"""
def draw_scene4():
print("This is scene 4")

"""
This is set up code that makes the story advance from
scene to scene. Feel free to check out this code and
learn how it works!
But be careful! If you modify this code the story might
not work anymore.
"""

scene_counter = 0

When this function is called the next scene is drawn.

def draw_next_screen(x, y):
global scene_counter
scene_counter += 1

if scene_counter == 1:
    draw_scene1()
elif scene_counter == 2:
    draw_scene2()
elif scene_counter == 3:
    draw_scene3()
else:
    draw_scene4()

welcome = Text("Click to Begin!")
welcome.set_position(get_width() / 2 - welcome.get_width() / 2, get_height() / 2)
add(welcome)

add_mouse_click_handler(draw_next_screen)

My idea is to:
Backround: Simple green grass and blue sky.
First scene: 2 circles are talking (about magic or something).
Second scene: Circle one now has a top hat and is offering to do a magic trick.
Third scene: Circle 2 dissapears.
Fourth scene: Circle 2 comes back dumbfounded.

Can somebody help me figure out the python that goes within the provided outline to create this 4 step scene. Thanks.

merry mesa
#

it's triple backticks (`), not triple quotes, for code blocks

velvet coyote
#

codehs might be different but thats how they want me to do it but thats just the outline i need actual code within each scene.

velvet coyote