diff options
author | cflip <cflip@cflip.net> | 2022-09-24 21:52:35 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-09-24 21:52:35 -0600 |
commit | 998a91e6b8d9ec3b6a6455f9685db650231bfc71 (patch) | |
tree | b5ac599beb192ec5293012561c38ea9864addcc9 | |
parent | f7b5af4ec8ef37c180c3dbdb9c0f787d5510907f (diff) |
Reduce scale of entire scene by 5 and upscale the window instead
-rw-r--r-- | project.godot | 14 | ||||
-rw-r--r-- | scenes/basketball.tscn | 6 | ||||
-rw-r--r-- | scenes/hoop.tscn | 3 | ||||
-rw-r--r-- | scenes/level.tscn | 13 | ||||
-rw-r--r-- | scripts/basketball.gd | 6 |
5 files changed, 24 insertions, 18 deletions
diff --git a/project.godot b/project.godot index 80c33ce..45e0fac 100644 --- a/project.godot +++ b/project.godot @@ -18,6 +18,14 @@ config/icon="res://icon.png" global_variables="*res://scripts/global_variables.gd" +[display] + +window/size/width=214 +window/size/height=120 +window/size/test_width=1070 +window/size/test_height=600 +window/stretch/mode="2d" + [gui] common/drop_mouse_on_gui_input_disabled=true @@ -33,4 +41,8 @@ shoot={ [physics] common/enable_pause_aware_picking=true -2d/default_gravity=981 +2d/default_gravity=196 + +[rendering] + +2d/snapping/use_gpu_pixel_snap=true diff --git a/scenes/basketball.tscn b/scenes/basketball.tscn index 9d2cd49..b3519c3 100644 --- a/scenes/basketball.tscn +++ b/scenes/basketball.tscn @@ -7,10 +7,10 @@ bounce = 0.65 [sub_resource type="CircleShape2D" id=1] -radius = 40.0 +radius = 8.0 [sub_resource type="CircleShape2D" id=3] -radius = 150.0 +radius = 30.0 [node name="Basketball" type="RigidBody2D"] physics_material_override = SubResource( 2 ) @@ -25,11 +25,9 @@ shape = SubResource( 1 ) [node name="GhostSprite" type="Sprite" parent="."] visible = false modulate = Color( 1, 1, 1, 0.494118 ) -scale = Vector2( 5, 5 ) texture = ExtResource( 1 ) [node name="Sprite" type="Sprite" parent="."] -scale = Vector2( 5, 5 ) texture = ExtResource( 1 ) [node name="OuterShape" type="Area2D" parent="."] diff --git a/scenes/hoop.tscn b/scenes/hoop.tscn index 15c10ce..5463a18 100644 --- a/scenes/hoop.tscn +++ b/scenes/hoop.tscn @@ -12,7 +12,6 @@ b = Vector2( -4.6, 11.4 ) extents = Vector2( 6.3, 0.55 ) [node name="Hoop" type="StaticBody2D"] -scale = Vector2( 5, 5 ) script = ExtResource( 3 ) [node name="BackgroundSprite" type="Sprite" parent="."] @@ -39,13 +38,11 @@ polygon = PoolVector2Array( 0.762794, -5.14728, 5.32917, 3.9975, 2.25312, 4.9326 [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] position = Vector2( -12.7, 10.75 ) -scale = Vector2( 1, 1 ) shape = SubResource( 2 ) [node name="CollisionPolygon2D2" type="CollisionPolygon2D" parent="."] position = Vector2( -12.5, 14.4 ) rotation = 3.14159 -scale = Vector2( 1, 1 ) polygon = PoolVector2Array( 10.9, 3.20002, -11.1, 3.19997, -8.49998, -3.60003, 7.50002, -3.59999 ) one_way_collision = true diff --git a/scenes/level.tscn b/scenes/level.tscn index e64ec43..1840d76 100644 --- a/scenes/level.tscn +++ b/scenes/level.tscn @@ -14,32 +14,31 @@ d = 10.0 [node name="Interface" parent="." instance=ExtResource( 4 )] [node name="Hoop" parent="." instance=ExtResource( 2 )] -position = Vector2( 796, 215 ) +position = Vector2( 164, 38 ) [node name="Floor" type="StaticBody2D" parent="."] position = Vector2( 684, 510 ) [node name="Sprite" type="Sprite" parent="Floor"] -position = Vector2( -3.05176e-05, 2.52724e-05 ) -scale = Vector2( 5, 5 ) +position = Vector2( -547, -408 ) texture = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="Floor"] +position = Vector2( -591, -397 ) shape = SubResource( 1 ) [node name="TextureRect" type="TextureRect" parent="Floor"] anchor_right = 1.0 margin_left = -684.0 -margin_top = -90.0 +margin_top = -426.0 margin_right = -619.0 -margin_bottom = -54.0 +margin_bottom = -390.0 grow_horizontal = 0 -rect_scale = Vector2( 5, 5 ) mouse_filter = 2 texture = ExtResource( 5 ) stretch_mode = 2 [node name="Basketball" parent="." instance=ExtResource( 3 )] -position = Vector2( 156, 371 ) +position = Vector2( 31, 73 ) [connection signal="score" from="Hoop" to="Interface" method="_on_Hoop_score"] diff --git a/scripts/basketball.gd b/scripts/basketball.gd index 14e898d..d9387de 100644 --- a/scripts/basketball.gd +++ b/scripts/basketball.gd @@ -1,7 +1,7 @@ extends RigidBody2D export var spin_speed = -1 -export var move_speed = 300 +export var move_speed = 60 var start_position var is_dragging = false @@ -28,7 +28,7 @@ func toggle_mode(): set_use_custom_integrator(waiting_for_shoot) func shoot(): - apply_impulse(Vector2(10, 10), Vector2(power)) + apply_impulse(Vector2(2, 2), Vector2(power)) # Override the default physics when we want to manually set the position and rotation. func _integrate_forces(state): @@ -46,7 +46,7 @@ func _process(delta): start_position.x -= move_speed * delta if Input.is_action_pressed("ui_right"): start_position.x += move_speed * delta - start_position.x = clamp(start_position.x, 0, 1024) + start_position.x = clamp(start_position.x, 0, get_viewport_rect().size.x) func _input(event): if event.is_action_pressed("shoot") and ready_to_hold and waiting_for_shoot: |