hi, I’m trying to make an animated presentation using processing.py, I got the presentation part down, but im having some trouble trying to add some animations into this, every YouTube video I’ve seen is for java and not python, so im kinda stuck and im not sure where to go or what to do, any help would be appreciated! here is my code, its really simple because im still a beginner
# Importing necessary libraries
from time import sleep
# Global variables
slide = 0
animation = 0
def setup():
size(600, 600);
def slide0():
background(255)
textSize(35)
textAlign(CENTER)
fill(0, 128, 0)
text("The Harmful Effects of E-Waste", width/2, height/2 - 40)
def slide1():
background(255)
textSize(24)
fill(0)
text("What is E-Waste?", 50, 100)
textSize(16)
textAlign(LEFT)
text("The UN defines e-waste as any discarded products with a battery\nor plug that contains toxic substances such as mercury, that can\npose as a severe risk to human as well as environmental health.", 50, 150)
# Slide 2: Negative impacts of e-waste
def slide2():
background(255)
textSize(24)
fill(0)
text("Negative Impacts", 50, 100)
textSize(16)
text("E-waste is not biodegradable. For example, open-air burning\nleads to air pollution and releases toxic substances into\nthe environment such as lead, mercury, and cadmium.\nThis puts human and animal health at risk.", 50, 150)
# Slide 3: Case studies/examples
def slide3():
background(255)
textSize(24)
fill(0)
text("Case Studies", 50, 100)
textSize(16)
text("Examples here.", 50, 150)
# Slide 4: Solutions
def slide4():
background(255)
textSize(24)
fill(0)
text("Solutions and Actions", 50, 100)
textSize(16)
text("List ways to reduce e-waste and encourage responsible\ndisposal and recycling of electronics.", 50, 150)
#Draw function
def draw():
global slide, animation
if slide == 0:
slide0()
elif slide == 1:
slide1()
elif slide == 2:
slide2()
elif slide == 3:
slide3()
elif slide == 4:
slide4()
#Mouse click function
def mouseClicked():
global slide, animation
if slide < 4:
slide += 1
else:
slide = 0
sleep(0.2)