Fruitydelicious Animations (11.02.2023) [FAST]
ani = animation.FuncAnimation(fig, animate, frames=100, interval=100)
# Fruit (apple) properties fruit, = ax.plot(5, 5, 'ro') Fruitydelicious animations (11.02.2023)
fruit.set_data(x, y) return fruit,
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation ani = animation
def animate(i): global vx, vy # Update fruit position x, y = fruit.get_data() x += vx y += vy ani = animation.FuncAnimation(fig
# Movement variables vx, vy = 2, 2