From ed3b37f6fa7b37429f79a7d229e1134ae316ed7e Mon Sep 17 00:00:00 2001 From: cflip Date: Fri, 23 Sep 2022 17:23:06 -0600 Subject: Replace the basketball sprite object with a RigidBody2D This way we don't have to implement all of the physics ourselves. --- basketball.tscn | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'basketball.tscn') diff --git a/basketball.tscn b/basketball.tscn index 2c8edf4..c7203d2 100644 --- a/basketball.tscn +++ b/basketball.tscn @@ -1,10 +1,21 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://ballforbasketing.png" type="Texture" id=1] -[ext_resource path="res://Sprite.gd" type="Script" id=2] +[ext_resource path="res://Basketball.gd" type="Script" id=2] -[node name="Sprite" type="Sprite"] -position = Vector2( 114, 478 ) +[sub_resource type="CircleShape2D" id=1] +radius = 40.0 + +[node name="Basketball" type="RigidBody2D"] +position = Vector2( 71, 541 ) +script = ExtResource( 2 ) +__meta__ = { +"_edit_group_": true +} + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="."] scale = Vector2( 5, 5 ) texture = ExtResource( 1 ) -script = ExtResource( 2 ) -- cgit v1.2.3