made the game real
This commit is contained in:
parent
dccc27dd72
commit
e2ddd9cefe
15 changed files with 211 additions and 10 deletions
BIN
bullet.png
Normal file
BIN
bullet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 389 B |
40
bullet.png.import
Normal file
40
bullet.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cm68ysi8ojc88"
|
||||
path="res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://bullet.png"
|
||||
dest_files=["res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
6
objects/player/bullet.gd
Normal file
6
objects/player/bullet.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
extends Node2D
|
||||
|
||||
@export var speed: Vector2
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position -= speed * delta
|
||||
1
objects/player/bullet.gd.uid
Normal file
1
objects/player/bullet.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b84vrx30l3hei
|
||||
12
objects/player/bullet.tscn
Normal file
12
objects/player/bullet.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bgoqv662xuf1r"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b84vrx30l3hei" path="res://objects/player/bullet.gd" id="1_4hrp6"]
|
||||
[ext_resource type="Texture2D" uid="uid://cm68ysi8ojc88" path="res://bullet.png" id="2_du4f6"]
|
||||
|
||||
[node name="Bullet" type="Node2D"]
|
||||
script = ExtResource("1_4hrp6")
|
||||
speed = Vector2(0, 500)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
position = Vector2(0, -5)
|
||||
texture = ExtResource("2_du4f6")
|
||||
22
objects/player/bullet_emitter/player_bullet_emitter.gd
Normal file
22
objects/player/bullet_emitter/player_bullet_emitter.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
extends Node2D
|
||||
|
||||
@export var Bullet: PackedScene
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("shoot"):
|
||||
$Timer.start()
|
||||
_on_timer_timeout()
|
||||
elif event.is_action_released("shoot"):
|
||||
$Timer.stop()
|
||||
|
||||
|
||||
func _on_timer_timeout() -> void:
|
||||
print("yeth")
|
||||
var bullet = Bullet.instantiate()
|
||||
get_owner().get_owner().add_child(bullet)
|
||||
bullet.global_position = $Marker2D.global_position
|
||||
|
||||
var bullet2 = Bullet.instantiate()
|
||||
get_owner().get_owner().add_child(bullet2)
|
||||
bullet2.global_position = $Marker2D2.global_position
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://c3kpy2v0yjdqf
|
||||
19
objects/player/bullet_emitter/player_bullet_emitter.tscn
Normal file
19
objects/player/bullet_emitter/player_bullet_emitter.tscn
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bs0tv5ubqdjp0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3kpy2v0yjdqf" path="res://objects/player/bullet_emitter/player_bullet_emitter.gd" id="1_51eej"]
|
||||
[ext_resource type="PackedScene" uid="uid://bgoqv662xuf1r" path="res://objects/player/bullet.tscn" id="2_xytg0"]
|
||||
|
||||
[node name="PlayerBulletEmitter" type="Node2D"]
|
||||
script = ExtResource("1_51eej")
|
||||
Bullet = ExtResource("2_xytg0")
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="."]
|
||||
position = Vector2(-7, -5)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="."]
|
||||
position = Vector2(7, -5)
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.1
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bs0tv5ubqdjp0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c3kpy2v0yjdqf" path="res://objects/player/bullet_emitter/player_bullet_emitter.gd" id="1_51eej"]
|
||||
|
||||
[node name="PlayerBulletEmitter" type="Node2D"]
|
||||
script = ExtResource("1_51eej")
|
||||
|
||||
[node name="Marker2D" type="Marker2D" parent="."]
|
||||
position = Vector2(-3, -1)
|
||||
|
||||
[node name="Marker2D2" type="Marker2D" parent="."]
|
||||
position = Vector2(3, -1)
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 0.1
|
||||
autostart = true
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||
|
|
@ -1,19 +1,21 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c714s5d7d5765"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://c714s5d7d5765"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bpo15kuxdmulu" path="res://objects/player/player.gd" id="1_cqmt1"]
|
||||
[ext_resource type="Texture2D" uid="uid://c50bfqprpitev" path="res://icon.svg" id="2_g7ett"]
|
||||
[ext_resource type="Texture2D" uid="uid://c82cpqafy7a23" path="res://testship.png" id="2_ssrue"]
|
||||
[ext_resource type="PackedScene" uid="uid://bs0tv5ubqdjp0" path="res://objects/player/bullet_emitter/player_bullet_emitter.tscn" id="3_ssrue"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ssrue"]
|
||||
size = Vector2(24, 24)
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
script = ExtResource("1_cqmt1")
|
||||
move_normal_speed = 150.0
|
||||
move_focused_speed = 75.0
|
||||
move_normal_speed = 200.0
|
||||
move_focused_speed = 100.0
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.25, 0.25)
|
||||
texture = ExtResource("2_g7ett")
|
||||
texture = ExtResource("2_ssrue")
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_ssrue")
|
||||
|
||||
[node name="PlayerBulletEmitter" parent="." instance=ExtResource("3_ssrue")]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://dfwa3gwtoor3t"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c50bfqprpitev" path="res://icon.svg" id="1_lv56f"]
|
||||
[ext_resource type="Texture2D" uid="uid://cokpdf3gw10kr" path="res://space.png" id="1_ikr60"]
|
||||
[ext_resource type="PackedScene" uid="uid://c714s5d7d5765" path="res://objects/player/player.tscn" id="2_ikr60"]
|
||||
|
||||
[node name="TestScene" type="Node"]
|
||||
|
||||
[node name="Icon" type="Sprite2D" parent="."]
|
||||
position = Vector2(110, 187)
|
||||
texture = ExtResource("1_lv56f")
|
||||
position = Vector2(120, 160)
|
||||
texture = ExtResource("1_ikr60")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("2_ikr60")]
|
||||
position = Vector2(100, 99)
|
||||
position = Vector2(124, 280)
|
||||
|
|
|
|||
BIN
space.png
Normal file
BIN
space.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
40
space.png.import
Normal file
40
space.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cokpdf3gw10kr"
|
||||
path="res://.godot/imported/space.png-81e1b11cffac9addd923b9f4eb36afe7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://space.png"
|
||||
dest_files=["res://.godot/imported/space.png-81e1b11cffac9addd923b9f4eb36afe7.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
testship.png
Normal file
BIN
testship.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 539 B |
40
testship.png.import
Normal file
40
testship.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c82cpqafy7a23"
|
||||
path="res://.godot/imported/testship.png-8081998be22a628e9a80e7231e20f46a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://testship.png"
|
||||
dest_files=["res://.godot/imported/testship.png-8081998be22a628e9a80e7231e20f46a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
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/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue