Skip to content

Commit

Permalink
[2D/destructible_terrain] update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrEliptik committed Sep 29, 2021
1 parent 2be14c8 commit 396c93c
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 71 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
2D/mobile_ui/android/build/*
2D/mobile_ui/android/.build_version
2D/hang/build/*
2D/destructible_terrain/build/*

3D/valheim_tree_chop/visuals/models/axe/blinn1SG.material
3D/valheim_tree_chop/visuals/models/axe/blinn2SG.material
91 changes: 91 additions & 0 deletions 2D/destructible_terrain/export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[preset.0]

name="HTML5"
platform="HTML5"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/destructible_terrain.html"
script_export_mode=1
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/experimental_virtual_keyboard=false

[preset.1]

name="Windows Desktop"
platform="Windows Desktop"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/destructible_terrain.exe"
script_export_mode=1
script_encryption_key=""

[preset.1.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
codesign/enable=false
codesign/identity_type=0
codesign/identity=""
codesign/password=""
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PoolStringArray( )
application/icon=""
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""

[preset.2]

name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="build/destructible_terrain.x86_64"
script_export_mode=1
script_encryption_key=""

[preset.2.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=true
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
4 changes: 2 additions & 2 deletions 2D/destructible_terrain/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ common/enable_pause_aware_picking=true

[rendering]

quality/filters/anisotropic_filter_level=16
quality/filters/msaa=4
quality/filters/anisotropic_filter_level=8
quality/filters/msaa=3
environment/default_environment="res://default_env.tres"
21 changes: 11 additions & 10 deletions 2D/destructible_terrain/scenes/bullet.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

[ext_resource path="res://scenes/bullet.gd" type="Script" id=1]

[sub_resource type="Gradient" id=2]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.346154, 0.774038, 1 )
colors = PoolColorArray( 0.992383, 0.203322, 0.203322, 1, 1, 0.662505, 0.0837889, 1, 0.98457, 0.976718, 0.517092, 1, 0.996078, 0.996078, 0.894118, 0 )

[sub_resource type="GradientTexture" id=3]
gradient = SubResource( 2 )
[sub_resource type="GradientTexture" id=2]
gradient = SubResource( 1 )
width = 128

[sub_resource type="Curve" id=4]
[sub_resource type="Curve" id=3]
_data = [ Vector2( 0, 0 ), 0.0, 0.0, 0, 0, Vector2( 0.057283, 1 ), 0.0, 0.0, 0, 0, Vector2( 0.853705, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0 ), -3.25343, 0.0, 0, 0 ]

[sub_resource type="CurveTexture" id=5]
curve = SubResource( 4 )
[sub_resource type="CurveTexture" id=4]
curve = SubResource( 3 )

[sub_resource type="ParticlesMaterial" id=1]
[sub_resource type="ParticlesMaterial" id=5]
flag_disable_z = true
direction = Vector3( -1, 0, 0 )
spread = 156.43
Expand All @@ -25,17 +25,18 @@ initial_velocity = 7.94
orbit_velocity = 0.0
orbit_velocity_random = 0.0
scale = 5.0
scale_curve = SubResource( 5 )
color_ramp = SubResource( 3 )
scale_curve = SubResource( 4 )
color_ramp = SubResource( 2 )

[node name="Bullet" type="Node2D"]
script = ExtResource( 1 )

[node name="Particles2D" type="Particles2D" parent="."]
modulate = Color( 1.5, 1.5, 1.5, 1 )
amount = 300
lifetime = 0.15
local_coords = false
process_material = SubResource( 1 )
process_material = SubResource( 5 )

[node name="Polygon2D" type="Polygon2D" parent="."]
antialiased = true
Expand Down
43 changes: 22 additions & 21 deletions 2D/destructible_terrain/scenes/explosionParticles.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

[ext_resource path="res://scenes/explosionParticles.gd" type="Script" id=1]

[sub_resource type="Gradient" id=4]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.254808, 0.75, 1 )
colors = PoolColorArray( 1, 1, 1, 1, 1, 0.406525, 0.310351, 1, 0.988477, 0.958719, 0.248856, 1, 0.996078, 0.988235, 0.776471, 0 )

[sub_resource type="GradientTexture" id=5]
gradient = SubResource( 4 )
[sub_resource type="GradientTexture" id=2]
gradient = SubResource( 1 )
width = 128

[sub_resource type="Curve" id=2]
[sub_resource type="Curve" id=3]
_data = [ Vector2( 0, 0 ), 0.0, 9.43657, 0, 0, Vector2( 0.146721, 1 ), -0.148042, -0.148042, 0, 0, Vector2( 1, 0.00831223 ), -2.40101, 0.0, 0, 0 ]

[sub_resource type="CurveTexture" id=3]
curve = SubResource( 2 )
[sub_resource type="CurveTexture" id=4]
curve = SubResource( 3 )

[sub_resource type="ParticlesMaterial" id=1]
[sub_resource type="ParticlesMaterial" id=5]
flag_disable_z = true
direction = Vector3( 0, 0, 0 )
spread = 127.86
Expand All @@ -29,24 +29,24 @@ orbit_velocity = 0.0
orbit_velocity_random = 0.0
scale = 155.55
scale_random = 0.48
scale_curve = SubResource( 3 )
color_ramp = SubResource( 5 )
scale_curve = SubResource( 4 )
color_ramp = SubResource( 2 )

[sub_resource type="Gradient" id=9]
[sub_resource type="Gradient" id=6]
offsets = PoolRealArray( 0, 0.754808, 1 )
colors = PoolColorArray( 0.14902, 0.0666667, 0.00784314, 1, 0.14902, 0.0666667, 0.00784314, 1, 0.14902, 0.0666667, 0.00784314, 0 )
colors = PoolColorArray( 0.333398, 0.223697, 0.14775, 1, 0.498039, 0.345098, 0.239216, 1, 0.14902, 0.0666667, 0.00784314, 0 )

[sub_resource type="GradientTexture" id=10]
gradient = SubResource( 9 )
[sub_resource type="GradientTexture" id=7]
gradient = SubResource( 6 )
width = 128

[sub_resource type="Curve" id=6]
[sub_resource type="Curve" id=8]
_data = [ Vector2( 0, 0.579497 ), 0.0, 0.0, 0, 0, Vector2( 0.274489, 1 ), -0.0738716, -0.0738716, 0, 0, Vector2( 1, 0 ), -1.25139, 0.0, 0, 0 ]

[sub_resource type="CurveTexture" id=7]
curve = SubResource( 6 )
[sub_resource type="CurveTexture" id=9]
curve = SubResource( 8 )

[sub_resource type="ParticlesMaterial" id=8]
[sub_resource type="ParticlesMaterial" id=10]
emission_shape = 1
emission_sphere_radius = 80.0
flag_disable_z = true
Expand All @@ -63,23 +63,24 @@ angle = 171.4
angle_random = 0.94
scale = 15.0
scale_random = 0.06
scale_curve = SubResource( 7 )
color_ramp = SubResource( 10 )
scale_curve = SubResource( 9 )
color_ramp = SubResource( 7 )

[node name="ExplosionParticles" type="Particles2D"]
modulate = Color( 1.5, 1.5, 1.5, 1 )
emitting = false
lifetime = 0.15
one_shot = true
explosiveness = 0.91
process_material = SubResource( 1 )
process_material = SubResource( 5 )
script = ExtResource( 1 )

[node name="DirtParticles" type="Particles2D" parent="."]
emitting = false
amount = 60
one_shot = true
explosiveness = 0.75
process_material = SubResource( 8 )
process_material = SubResource( 10 )

[node name="Timer" type="Timer" parent="."]

Expand Down
7 changes: 6 additions & 1 deletion 2D/destructible_terrain/scenes/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ func _ready() -> void:
pass

func _process(delta: float) -> void:
pass
$Camera2D.global_position = $Player.global_position + Vector2(0, -250)
var offset_h = (get_global_mouse_position().x - 1920) / (1920/2)
var offset_v = (get_global_mouse_position().y - 1080) / (1080/2)
# var offset_v = (Vector2(1920/2, 1080/2) - get_global_mouse_position()).normalized()
$Camera2D.offset_h = offset_h
$Camera2D.offset_v = offset_v

func _physics_process(delta: float) -> void:
update_trajectory(delta)
Expand Down
Loading

0 comments on commit 396c93c

Please sign in to comment.