To illustrate the change here is a script who add a shape to a physic body in Godot 3.
extends KinematicBody2D
export (float) var radius = 100
export (Color) var ballColor = Color(1, 1, 1)
onready var shapeOwnerID = create_shape_owner(self)
func _ready():
shape_owner_add_shape(shapeOwnerID, CircleShape2D.new())
shape_owner_get_shape(shapeOwnerID, 0).set_radius(radius)
func _draw():
draw_circle(Vector2(0, 0), radius, ballColor)
And the same task but in Godot 2. Straightforward isn't it ?
extends KinematicBody2D
export (float) var radius = 100
export (Color) var ballColor = Color(1, 1, 1)
func _ready():
add_shape(CircleShape2D.new())
get_shape(0).set_radius(radius)
func _draw():
draw_circle(Vector2(0, 0), radius, ballColor)