Here's an example of code that implements the described functionality in Gdscript using the Godot game engine. This code assumes that the circle will be drawn on a Node2D.
extends Node2D
var radius = 35
var delta_radius = 0
var time = 0
func _process(delta):
time += delta
if time >= 5:
delta_radius = (135 - radius) / 8
radius += delta_radius
if radius >= 135:
delta_radius = -(135 - radius) / 5
radius += delta_radius
if radius <= 35:
radius = 35
time = 0
queue_redraw()
func _draw():
draw_circle(Vector2.ZERO, radius, Vector2.UP, Color.YELLOW)
This code first defines the initial radius of the circle as 35 pixels and initializes two variables, delta_radius and time, to 0. The _process() function is called every frame and updates the time variable. If time is greater than or equal to 5 seconds, the delta_radius variable is set to the difference between the target radius of 135 pixels and the current radius, divided by 8 seconds. The radius is then updated by adding delta_radius and the process repeats until the radius reaches 135 pixels. At this point, delta_radius is set to the negative of the difference between the target radius of 35 pixels and the current radius, divided by 5 seconds, and the radius is updated in the same way until it reaches 35 pixels again. The _draw() function is then called to draw the circle at its current radius with the center at (0, 0) and a yellow color. The queue_redraw() function is called after updating the radius variable to update the _draw() function.