diff --git a/visual_script/circle_pop/Circle.tscn b/visual_script/circle_pop/Circle.tscn index 02330607..1af671d1 100644 --- a/visual_script/circle_pop/Circle.tscn +++ b/visual_script/circle_pop/Circle.tscn @@ -4,34 +4,17 @@ [ext_resource path="res://CircleArea.vs" type="Script" id=2] [sub_resource type="CanvasItemMaterial" id=1] - -render_priority = 0 blend_mode = 1 -light_mode = 0 [sub_resource type="CircleShape2D" id=2] - -custom_solver_bias = 0.0 radius = 128.0 -[node name="Sprite" type="Sprite" index="0"] - +[node name="Sprite" type="Sprite"] material = SubResource( 1 ) texture = ExtResource( 1 ) -[node name="Area2D" type="Area2D" parent="." index="0"] - -input_pickable = true -gravity_vec = Vector2( 0, 1 ) -gravity = 98.0 -linear_damp = 0.1 -angular_damp = 1.0 -audio_bus_override = false -audio_bus_name = "Master" +[node name="Area2D" type="Area2D" parent="."] script = ExtResource( 2 ) -[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D" index="0"] - +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] shape = SubResource( 2 ) - - diff --git a/visual_script/circle_pop/CircleArea.vs b/visual_script/circle_pop/CircleArea.vs index 062ee8f8..d3e4a308 100644 Binary files a/visual_script/circle_pop/CircleArea.vs and b/visual_script/circle_pop/CircleArea.vs differ diff --git a/visual_script/circle_pop/Main.vs b/visual_script/circle_pop/Main.vs index 18576990..49542df6 100644 Binary files a/visual_script/circle_pop/Main.vs and b/visual_script/circle_pop/Main.vs differ diff --git a/visual_script/multitouch_view/Main.vs b/visual_script/multitouch_view/Main.vs index 63b7e6c0..b8e3e68a 100644 Binary files a/visual_script/multitouch_view/Main.vs and b/visual_script/multitouch_view/Main.vs differ diff --git a/visual_script/multitouch_view/TouchHelper.gd b/visual_script/multitouch_view/TouchHelper.gd index 5abf271d..93f4725f 100644 --- a/visual_script/multitouch_view/TouchHelper.gd +++ b/visual_script/multitouch_view/TouchHelper.gd @@ -1,43 +1,39 @@ +extends Node # This will track the position of every pointer in its public `state` property, which is a # Dictionary, in which each key is a pointer id (integer) and each value its position (Vector2). # It works by listening to input events not handled by other means. # It also remaps the pointer indices coming from the OS to the lowest available to be friendlier. # It can be conveniently setup as a singleton. -extends Node - var state = {} var _os2own = {} func _unhandled_input(event): if event is InputEventScreenTouch: - if event.pressed: - # Down - if !_os2own.has(event.index): # Defensively discard index if already known + if event.pressed: # Down. + if !_os2own.has(event.index): # Defensively discard index if already known. var ptr_id = _find_free_pointer_id() state[ptr_id] = event.position _os2own[event.index] = ptr_id - else: - # Up - if _os2own.has(event.index): # Defensively discard index if not known + else: # Up. + if _os2own.has(event.index): # Defensively discard index if not known. var ptr_id = _os2own[event.index] state.erase(ptr_id) _os2own.erase(event.index) return true - - elif event is InputEventScreenDrag: - # Move - if _os2own.has(event.index): # Defensively discard index if not known + + elif event is InputEventScreenDrag: # Movement. + if _os2own.has(event.index): # Defensively discard index if not known. var ptr_id = _os2own[event.index] state[ptr_id] = event.position return true - + return false + func _find_free_pointer_id(): var used = state.keys() var i = 0 while i in used: i += 1 return i - diff --git a/visual_script/pong/scripts/ball.vs b/visual_script/pong/scripts/ball.vs index eedd0693..660005b8 100644 Binary files a/visual_script/pong/scripts/ball.vs and b/visual_script/pong/scripts/ball.vs differ diff --git a/visual_script/pong/scripts/ceiling_floor.vs b/visual_script/pong/scripts/ceiling_floor.vs index 987a8017..8ed76a5f 100644 Binary files a/visual_script/pong/scripts/ceiling_floor.vs and b/visual_script/pong/scripts/ceiling_floor.vs differ diff --git a/visual_script/pong/scripts/paddle.vs b/visual_script/pong/scripts/paddle.vs index c110cf5d..6e20ed14 100644 Binary files a/visual_script/pong/scripts/paddle.vs and b/visual_script/pong/scripts/paddle.vs differ diff --git a/visual_script/pong/scripts/wall.vs b/visual_script/pong/scripts/wall.vs index 321e7b1f..f022b1ac 100644 Binary files a/visual_script/pong/scripts/wall.vs and b/visual_script/pong/scripts/wall.vs differ