first commit
This commit is contained in:
commit
a673773183
21 changed files with 305 additions and 0 deletions
4
.editorconfig
Normal file
4
.editorconfig
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# Normalize EOL for all files that Git considers text files.
|
||||||
|
* text=auto eol=lf
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Godot 4+ specific ignores
|
||||||
|
.godot/
|
||||||
|
/android/
|
||||||
BIN
assets/ball.png
Normal file
BIN
assets/ball.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 205 B |
34
assets/ball.png.import
Normal file
34
assets/ball.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://mucscwsbmfoq"
|
||||||
|
path="res://.godot/imported/ball.png-ca93c4f2e7b7f8325cbd933673092ff4.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/ball.png"
|
||||||
|
dest_files=["res://.godot/imported/ball.png-ca93c4f2e7b7f8325cbd933673092ff4.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
assets/bumper.png
Normal file
BIN
assets/bumper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 402 B |
34
assets/bumper.png.import
Normal file
34
assets/bumper.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bjkqwg7x8boun"
|
||||||
|
path="res://.godot/imported/bumper.png-47785785aa6eb7e7a0af4baae66981c0.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/bumper.png"
|
||||||
|
dest_files=["res://.godot/imported/bumper.png-47785785aa6eb7e7a0af4baae66981c0.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
assets/flipper.png
Normal file
BIN
assets/flipper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 204 B |
34
assets/flipper.png.import
Normal file
34
assets/flipper.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b1r22t327pigo"
|
||||||
|
path="res://.godot/imported/flipper.png-2cdce6cc85fc06ace0566b75e4769636.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/flipper.png"
|
||||||
|
dest_files=["res://.godot/imported/flipper.png-2cdce6cc85fc06ace0566b75e4769636.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
1
icon.svg
Normal file
1
icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||||
|
After Width: | Height: | Size: 994 B |
37
icon.svg.import
Normal file
37
icon.svg.import
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c8mo17gcly66y"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
18
main.tscn
Normal file
18
main.tscn
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
[gd_scene format=3 uid="uid://bgc35bo4ej4l1"]
|
||||||
|
|
||||||
|
[node name="main" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="SubViewport" type="SubViewport" parent="."]
|
||||||
|
size = Vector2i(1080, 1920)
|
||||||
|
|
||||||
|
[node name="SafeArea" type="Control" parent="SubViewport"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 8
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_right = 900.0
|
||||||
|
offset_bottom = 1600.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
9
pinball/ball.gd
Normal file
9
pinball/ball.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
mass = 1.0
|
||||||
|
gravity_scale = 1.0
|
||||||
|
physics_material_override.bounce = 0.8
|
||||||
|
linear_damp = 0.1
|
||||||
|
contact_monitor = true
|
||||||
|
max_contacts_reported = 4
|
||||||
1
pinball/ball.gd.uid
Normal file
1
pinball/ball.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://by01oc4lqlma4
|
||||||
19
pinball/ball.tscn
Normal file
19
pinball/ball.tscn
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_scene load_steps=5 format=3 uid="uid://bri6gyx0bp87t"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://mucscwsbmfoq" path="res://assets/ball.png" id="1_qbdsi"]
|
||||||
|
[ext_resource type="Script" uid="uid://by01oc4lqlma4" path="res://pinball/ball.gd" id="1_qu1p4"]
|
||||||
|
|
||||||
|
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_s64ax"]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_o681m"]
|
||||||
|
radius = 4.0
|
||||||
|
|
||||||
|
[node name="Ball" type="RigidBody2D"]
|
||||||
|
physics_material_override = SubResource("PhysicsMaterial_s64ax")
|
||||||
|
script = ExtResource("1_qu1p4")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_o681m")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("1_qbdsi")
|
||||||
8
pinball/bumper.tscn
Normal file
8
pinball/bumper.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
[gd_scene load_steps=2 format=3 uid="uid://b4mlc72u3danp"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bjkqwg7x8boun" path="res://assets/bumper.png" id="1_gph4f"]
|
||||||
|
|
||||||
|
[node name="Bumper" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("1_gph4f")
|
||||||
35
pinball/flipper.gd
Normal file
35
pinball/flipper.gd
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
@export var flip_strength: float = 50.0
|
||||||
|
@export var rest_strength: float = 20.0
|
||||||
|
@export var right_flipper: bool = false
|
||||||
|
|
||||||
|
var rest_angle: float = 0.0
|
||||||
|
var flipped_angle: float = -60.0 #deg
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
gravity_scale = 0.0
|
||||||
|
freeze = false
|
||||||
|
|
||||||
|
if right_flipper:
|
||||||
|
flipped_angle *= -1
|
||||||
|
rest_angle *= -1
|
||||||
|
|
||||||
|
rotation_degrees = rest_angle
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void:
|
||||||
|
if right_flipper and event.is_action_pressed("right_flipper"):
|
||||||
|
flip()
|
||||||
|
elif !right_flipper and event.is_action_pressed("left_flipper"):
|
||||||
|
flip()
|
||||||
|
|
||||||
|
if right_flipper and event.is_action_released("right_flipper"):
|
||||||
|
rest()
|
||||||
|
elif !right_flipper and event.is_action_released("left_flipper"):
|
||||||
|
rest()
|
||||||
|
|
||||||
|
func flip() -> void:
|
||||||
|
angular_velocity = flip_strength
|
||||||
|
|
||||||
|
func rest() -> void:
|
||||||
|
angular_velocity = -rest_strength
|
||||||
1
pinball/flipper.gd.uid
Normal file
1
pinball/flipper.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://fnuonblf0vk2
|
||||||
15
pinball/flipper.tscn
Normal file
15
pinball/flipper.tscn
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://idjf5lor2py2"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b1r22t327pigo" path="res://assets/flipper.png" id="1_duuhy"]
|
||||||
|
|
||||||
|
[sub_resource type="ConcavePolygonShape2D" id="ConcavePolygonShape2D_duuhy"]
|
||||||
|
|
||||||
|
[node name="Flipper" type="RigidBody2D"]
|
||||||
|
|
||||||
|
[node name="Flipper" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(-26, -3)
|
||||||
|
texture = ExtResource("1_duuhy")
|
||||||
|
offset = Vector2(26, 3)
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("ConcavePolygonShape2D_duuhy")
|
||||||
3
pinball/table.tscn
Normal file
3
pinball/table.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[gd_scene format=3 uid="uid://2bnojgnoj8df"]
|
||||||
|
|
||||||
|
[node name="Table" type="Node2D"]
|
||||||
47
project.godot
Normal file
47
project.godot
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="pinballatro"
|
||||||
|
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=270
|
||||||
|
window/size/viewport_height=480
|
||||||
|
window/size/window_width_override=540
|
||||||
|
window/size/window_height_override=960
|
||||||
|
window/stretch/mode="viewport"
|
||||||
|
window/stretch/aspect="keep_width"
|
||||||
|
window/stretch/scale_mode="integer"
|
||||||
|
window/handheld/orientation=1
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
left_flipper={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
right_flipper={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":79,"key_label":0,"unicode":111,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
textures/canvas_textures/default_texture_filter=0
|
||||||
|
renderer/rendering_method="gl_compatibility"
|
||||||
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
|
textures/decals/filter=0
|
||||||
|
textures/light_projectors/filter=0
|
||||||
Loading…
Add table
Add a link
Reference in a new issue