-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d2fe8f
commit 6891753
Showing
10 changed files
with
178 additions
and
27 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
extends StaticBody | ||
|
||
|
||
#func _process(delta): | ||
# burn_mark() | ||
|
||
var last_position = [Vector2(0,-50),Vector2(0,-50)] | ||
|
||
var C_LEFT = Color() | ||
var C_RIGHT = Color() | ||
|
||
func update_colors(COLOR_LEFT,COLOR_RIGHT): | ||
C_LEFT = COLOR_LEFT | ||
C_RIGHT = COLOR_RIGHT | ||
$Viewport/ColorRect/burn_l.modulate = C_LEFT*6 | ||
$Viewport/ColorRect/burn_r.modulate = C_RIGHT*6 | ||
|
||
var is_out = [0,0] | ||
func burn_mark(position=Vector3(0,0,-50),type=0): | ||
var burn_mark_sprite | ||
var burn_mark_sprite_long | ||
if type == 0: | ||
burn_mark_sprite = $Viewport/ColorRect/burn_l | ||
burn_mark_sprite_long = $Viewport/ColorRect/burn_l/sprite | ||
elif type == 1: | ||
burn_mark_sprite = $Viewport/ColorRect/burn_r | ||
burn_mark_sprite_long = $Viewport/ColorRect/burn_r/sprite | ||
else: | ||
return | ||
var was_out = !burn_mark_sprite.visible | ||
burn_mark_sprite.visible = true | ||
is_out[type] = 0 | ||
|
||
var newpos = Vector2( | ||
(position.x+1)*256, | ||
position.z*256 | ||
) | ||
|
||
burn_mark_sprite.position = newpos | ||
|
||
burn_mark_sprite.rotation = newpos.angle_to_point(last_position[type]) | ||
burn_mark_sprite.rotation_degrees += 180 | ||
var dist = last_position[type].distance_to(newpos) | ||
if dist > 12 and not was_out: | ||
burn_mark_sprite_long.rect_size.x = dist+12 | ||
else: | ||
burn_mark_sprite_long.rect_size.x = 24 | ||
|
||
last_position[type] = newpos | ||
|
||
func _process(delta): | ||
if is_out[0] == 1: | ||
$Viewport/ColorRect/burn_l.visible = false | ||
if is_out[1] == 1: | ||
$Viewport/ColorRect/burn_r.visible = false | ||
is_out = [1,1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
[gd_scene load_steps=9 format=2] | ||
|
||
[ext_resource path="res://game/BeepCube_Cut.material" type="Material" id=1] | ||
[ext_resource path="res://game/floor.gd" type="Script" id=3] | ||
|
||
[sub_resource type="BoxShape" id=1] | ||
|
||
[sub_resource type="PlaneMesh" id=2] | ||
size = Vector2( 0.5, 0.5 ) | ||
|
||
[sub_resource type="ViewportTexture" id=3] | ||
viewport_path = NodePath("Viewport") | ||
|
||
[sub_resource type="SpatialMaterial" id=4] | ||
resource_local_to_scene = true | ||
flags_unshaded = true | ||
albedo_texture = SubResource( 3 ) | ||
|
||
[sub_resource type="CanvasItemMaterial" id=6] | ||
blend_mode = 1 | ||
|
||
[sub_resource type="StyleBoxFlat" id=5] | ||
bg_color = Color( 1, 1, 1, 1 ) | ||
border_width_left = 8 | ||
border_width_top = 8 | ||
border_width_right = 8 | ||
border_width_bottom = 8 | ||
border_color = Color( 0, 0, 0, 1 ) | ||
border_blend = true | ||
corner_radius_top_left = 11 | ||
corner_radius_top_right = 11 | ||
corner_radius_bottom_right = 11 | ||
corner_radius_bottom_left = 11 | ||
corner_detail = 6 | ||
|
||
[node name="StandingGround" type="StaticBody" groups=[ | ||
"floor", | ||
]] | ||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1 ) | ||
collision_layer = 8 | ||
collision_mask = 8 | ||
script = ExtResource( 3 ) | ||
|
||
[node name="CollisionShape" type="CollisionShape" parent="."] | ||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0 ) | ||
shape = SubResource( 1 ) | ||
|
||
[node name="Spatial" type="Spatial" parent="."] | ||
transform = Transform( 4, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0 ) | ||
|
||
[node name="MeshInstance" type="MeshInstance" parent="Spatial"] | ||
mesh = SubResource( 2 ) | ||
material/0 = ExtResource( 1 ) | ||
|
||
[node name="MeshInstance2" type="MeshInstance" parent="Spatial"] | ||
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.001, 0 ) | ||
mesh = SubResource( 2 ) | ||
material/0 = SubResource( 4 ) | ||
|
||
[node name="Viewport" type="Viewport" parent="."] | ||
size = Vector2( 512, 512 ) | ||
render_target_v_flip = true | ||
render_target_clear_mode = 1 | ||
|
||
[node name="ColorRect" type="ColorRect" parent="Viewport"] | ||
margin_right = 512.0 | ||
margin_bottom = 512.0 | ||
color = Color( 0, 0, 0, 0.027451 ) | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="burn_l" type="Node2D" parent="Viewport/ColorRect"] | ||
position = Vector2( -64, -64 ) | ||
|
||
[node name="sprite" type="Panel" parent="Viewport/ColorRect/burn_l"] | ||
material = SubResource( 6 ) | ||
margin_left = -12.0 | ||
margin_top = -12.0 | ||
margin_right = 12.0 | ||
margin_bottom = 12.0 | ||
custom_styles/panel = SubResource( 5 ) | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="burn_r" type="Node2D" parent="Viewport/ColorRect"] | ||
position = Vector2( -64, -64 ) | ||
|
||
[node name="sprite" type="Panel" parent="Viewport/ColorRect/burn_r"] | ||
material = SubResource( 6 ) | ||
margin_left = -12.0 | ||
margin_top = -12.0 | ||
margin_right = 12.0 | ||
margin_bottom = 12.0 | ||
custom_styles/panel = SubResource( 5 ) | ||
__meta__ = { | ||
"_edit_use_anchors_": false | ||
} |