This commit is contained in:
ultrablob 2024-04-22 07:51:43 -04:00
parent 0f8adcca8e
commit 28b9c41bbc
9 changed files with 279 additions and 48 deletions

View file

@ -1,6 +1,8 @@
extends Marker2D extends Marker2D
@export var item: PackedScene @export var item: PackedScene
var portal = preload("res://portal.tscn")
@export var portal_texture: SpriteFrames
@export var random_off_screen = false @export var random_off_screen = false
@export var radius = 100 @export var radius = 100
@ -26,8 +28,12 @@ func spawn():
break break
var portal_effect = portal.instantiate()
portal_effect.global_position = spawn_loc
portal_effect.sprite_frames = portal_texture
$/root/Node2D.add_child(portal_effect)
await get_tree().create_timer(0.6).timeout
var node = item.instantiate() var node = item.instantiate()
node.global_position = spawn_loc node.global_position = spawn_loc
node.rotation_degrees = 360 * randf() node.rotation_degrees = 360 * randf()
print(node.global_position)
$/root/Node2D.add_child(node) $/root/Node2D.add_child(node)

View file

@ -28,7 +28,7 @@ html/head_include=""
html/canvas_resize_policy=2 html/canvas_resize_policy=2
html/focus_canvas_on_start=true html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false progressive_web_app/enabled=true
progressive_web_app/offline_page="" progressive_web_app/offline_page=""
progressive_web_app/display=1 progressive_web_app/display=1
progressive_web_app/orientation=0 progressive_web_app/orientation=0

88
ircle_portal.tres Normal file
View file

@ -0,0 +1,88 @@
[gd_resource type="SpriteFrames" load_steps=13 format=3 uid="uid://dh2kuw87g8lsx"]
[ext_resource type="Texture2D" uid="uid://bsgypq0rnump0" path="res://portal.png" id="1_y4vfr"]
[sub_resource type="AtlasTexture" id="AtlasTexture_b07j3"]
atlas = ExtResource("1_y4vfr")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_cblso"]
atlas = ExtResource("1_y4vfr")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_5yk7s"]
atlas = ExtResource("1_y4vfr")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_a65u8"]
atlas = ExtResource("1_y4vfr")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_s3j5a"]
atlas = ExtResource("1_y4vfr")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_vwlm1"]
atlas = ExtResource("1_y4vfr")
region = Rect2(320, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_uknb4"]
atlas = ExtResource("1_y4vfr")
region = Rect2(384, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_qukqn"]
atlas = ExtResource("1_y4vfr")
region = Rect2(448, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_mvy6v"]
atlas = ExtResource("1_y4vfr")
region = Rect2(512, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_0aqdp"]
atlas = ExtResource("1_y4vfr")
region = Rect2(576, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_0epey"]
atlas = ExtResource("1_y4vfr")
region = Rect2(640, 0, 64, 64)
[resource]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_b07j3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_cblso")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5yk7s")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a65u8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s3j5a")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vwlm1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_uknb4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qukqn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mvy6v")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0aqdp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0epey")
}],
"loop": true,
"name": &"default",
"speed": 10.0
}]

109
main.tscn

File diff suppressed because one or more lines are too long

BIN
portal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

34
portal.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bsgypq0rnump0"
path="res://.godot/imported/portal.png-cac28fad10330d5df5782c260ec8497f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://portal.png"
dest_files=["res://.godot/imported/portal.png-cac28fad10330d5df5782c260ec8497f.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

View file

@ -1,46 +1,12 @@
[gd_scene load_steps=7 format=3 uid="uid://chn8kuplnjxik"] [gd_scene load_steps=2 format=3 uid="uid://chn8kuplnjxik"]
[ext_resource type="Texture2D" uid="uid://baaak3ooc6rvq" path="res://Hexagon.png" id="1_lhm7s"] [ext_resource type="SpriteFrames" uid="uid://dh2kuw87g8lsx" path="res://ircle_portal.tres" id="1_vdx4s"]
[sub_resource type="Gradient" id="Gradient_ejv0r"] [node name="Portal" type="AnimatedSprite2D"]
interpolation_mode = 2 z_index = 5
offsets = PackedFloat32Array(0, 0.278689, 0.737705, 1) texture_filter = 1
colors = PackedColorArray(1, 0.6, 0, 0, 1, 0.6, 0, 1, 1, 0.6, 0, 1, 1, 0.6, 0, 0) scale = Vector2(1.5, 1.5)
sprite_frames = ExtResource("1_vdx4s")
autoplay = "default"
[sub_resource type="GradientTexture1D" id="GradientTexture1D_mfh8i"] [connection signal="animation_looped" from="." to="." method="queue_free"]
gradient = SubResource("Gradient_ejv0r")
[sub_resource type="Curve" id="Curve_imaul"]
min_value = -10.0
max_value = 10.0
_data = [Vector2(0, -10), 0.0, 0.0, 0, 0, Vector2(1, 2.74725), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_6sfnf"]
curve = SubResource("Curve_imaul")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_e6bpl"]
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 200.0
spread = 0.0
gravity = Vector3(0, 0, 0)
radial_accel_min = 1.0
radial_accel_max = 2.0
radial_accel_curve = SubResource("CurveTexture_6sfnf")
tangential_accel_min = 1.0
tangential_accel_max = 5.0
scale_min = 0.02
scale_max = 0.02
color_ramp = SubResource("GradientTexture1D_mfh8i")
[node name="Spawner" type="Node2D"]
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
z_index = 10
emitting = false
amount = 1000
process_material = SubResource("ParticleProcessMaterial_e6bpl")
texture = ExtResource("1_lhm7s")
lifetime = 5.0
one_shot = true

BIN
riangle-portal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

34
riangle-portal.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bu70lwr6f3igy"
path="res://.godot/imported/riangle-portal.png-a304b12590c21c047e54bde638ab02a8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://riangle-portal.png"
dest_files=["res://.godot/imported/riangle-portal.png-a304b12590c21c047e54bde638ab02a8.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