stripedhyena-nous-7b· Together AI
Arena Human Preference 55K
Write code in Gdscript for the Godot gameengine that draws a yellow circle with a radius…
- User
Write code in Gdscript for the Godot gameengine that draws a yellow circle with a radius of 35 pixel.The circle has to grow linear from 35 pixel to 135 pixel within 5 seconds. After that time the circle has to go back to 35 pixel linear within 8 seconds. The growing and shrinking should go constantly. Use lerp. Use the inbuild _draw function of the Godot engine. Use the queue_redraw() function to update the _draw() function.
- Assistant
extends Node var circle_radius: int = 35 var circle_grow_time: float = 5 var circle_shrink_time: float = 8 func _ready(): queue_redraw() func _draw(): with_alpha(COLOR_WHITE): draw_circle(CENTER_MOUSE, circle_radius, PAL_CIRCLE) var circle_lerp_time: float = circle_grow_time var circle_lerp_from: float = circle_radius var circle_lerp_to: float = 135 func circle_grow(): if circle_lerp_time > 0: circle_lerp_time -= get_time() circle_radius = lerp(circle_lerp_from, circle_lerp_to, circle_lerp_time / circle_grow_time) if circle_lerp_time <= 0: circle_shrink() func circle_shrink(): if circle_lerp_time < circle_grow_time: circle_lerp_time += get_time() circle_radius = lerp(circle_lerp_to, circle_lerp_from, circle_lerp_time / circle_shrink_time) if circle_lerp_time >= circle_grow_time: circle_grow() queue_redraw()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.