mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
commit
This commit is contained in:
parent
a576dc0f5f
commit
2741c1e314
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
|
||||||
|
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
|
||||||
|
|
||||||
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="9af3d6b87828d63b47b64d8f55268047"
|
||||||
|
dest_md5="756347001080602f89f78ec386be2b42"
|
||||||
|
|
||||||
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="9a8d5d95e162b71bd961db4150968a60"
|
||||||
|
dest_md5="4f8aa6a0885b0f2b6a56014ddf6aee0c"
|
||||||
|
|
||||||
Binary file not shown.
36
Pavels/bullet_trajectory/Bullet.gd
Normal file
36
Pavels/bullet_trajectory/Bullet.gd
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
extends Area2D
|
||||||
|
|
||||||
|
export var speed = 40
|
||||||
|
var velocity = Vector2()
|
||||||
|
var rot = Vector2()
|
||||||
|
|
||||||
|
var time = 0
|
||||||
|
export var amplitude = 4
|
||||||
|
export var frequency = 5
|
||||||
|
|
||||||
|
|
||||||
|
func follow_line_trajectory():
|
||||||
|
velocity = Vector2(1, 0) #Vector2(cos(self.global_rotation), sin(self.global_rotation))
|
||||||
|
pass
|
||||||
|
|
||||||
|
func follow_sine_trajectory():
|
||||||
|
velocity.y = amplitude * cos(time * frequency)
|
||||||
|
velocity.x = 5
|
||||||
|
pass
|
||||||
|
|
||||||
|
func follow_parabolic_trajectory():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func follow_hyperbolic_trajectory():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
follow_sine_trajectory()
|
||||||
|
time += delta
|
||||||
|
position += velocity * speed * delta
|
||||||
|
|
||||||
|
|
||||||
|
func _on_Bullet_body_entered(body):
|
||||||
|
if body.is_in_group("mobs"):
|
||||||
|
body.queue_free()
|
||||||
|
queue_free()
|
||||||
22
Pavels/bullet_trajectory/Bullet.tscn
Normal file
22
Pavels/bullet_trajectory/Bullet.tscn
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://pixil-frame-0 (1).png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://Bullet.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id=1]
|
||||||
|
radius = 5.4212
|
||||||
|
height = 7.62897
|
||||||
|
|
||||||
|
[node name="Bullet" type="Area2D"]
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
position = Vector2( -1.5874, -18.2551 )
|
||||||
|
scale = Vector2( 0.199834, 0.199834 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_Bullet_body_entered"]
|
||||||
19
Pavels/bullet_trajectory/Env.gd
Normal file
19
Pavels/bullet_trajectory/Env.gd
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
extends Node2D
|
||||||
|
|
||||||
|
onready var bullet = preload("res://Bullet.tscn")
|
||||||
|
var time = 0
|
||||||
|
|
||||||
|
#func _ready():
|
||||||
|
# connect("body_entered", self, "_on_Bullet_body_entered")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func trigger():
|
||||||
|
var b = bullet.instance()
|
||||||
|
add_child(b)
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
time += delta
|
||||||
|
if time > 10:
|
||||||
|
queue_free()
|
||||||
10
Pavels/bullet_trajectory/Env.tscn
Normal file
10
Pavels/bullet_trajectory/Env.tscn
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Env.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://Bullet.tscn" type="PackedScene" id=2]
|
||||||
|
|
||||||
|
[node name="Env" type="Node2D"]
|
||||||
|
position = Vector2( 437.266, 290.109 )
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Bullet" parent="." instance=ExtResource( 2 )]
|
||||||
4
Pavels/bullet_trajectory/Gun.gd
Normal file
4
Pavels/bullet_trajectory/Gun.gd
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
extends Position2D
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
look_at(get_global_mouse_position())
|
||||||
27
Pavels/bullet_trajectory/KinematicBody2D.gd
Normal file
27
Pavels/bullet_trajectory/KinematicBody2D.gd
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
onready var env = preload("res://Env.tscn")
|
||||||
|
export var speed = 400
|
||||||
|
var movement = Vector2(0, 0)
|
||||||
|
|
||||||
|
func shoot():
|
||||||
|
var b = env.instance()
|
||||||
|
get_parent().add_child(b)
|
||||||
|
b.global_transform = $Gun.global_transform
|
||||||
|
|
||||||
|
func get_input():
|
||||||
|
movement = Vector2()
|
||||||
|
if Input.is_action_pressed("ui_right"):
|
||||||
|
movement.x += 10
|
||||||
|
if Input.is_action_pressed("ui_left"):
|
||||||
|
movement.x -= 10
|
||||||
|
if Input.is_action_pressed("ui_down"):
|
||||||
|
movement.y += 10
|
||||||
|
if Input.is_action_pressed("ui_up"):
|
||||||
|
movement.y -= 10
|
||||||
|
if Input.is_action_just_pressed("shoot"):
|
||||||
|
shoot()
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
get_input()
|
||||||
|
position += movement.normalized() * speed * delta
|
||||||
10
Pavels/bullet_trajectory/Mob.gd
Normal file
10
Pavels/bullet_trajectory/Mob.gd
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
|
||||||
|
var velocity = Vector2(1, 1)
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
var collision = move_and_collide(velocity * delta)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
19
Pavels/bullet_trajectory/Player.tscn
Normal file
19
Pavels/bullet_trajectory/Player.tscn
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://pixilart-drawing.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://KinematicBody2D.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
extents = Vector2( 22.279, 10 )
|
||||||
|
|
||||||
|
[node name="Player" type="KinematicBody2D"]
|
||||||
|
position = Vector2( 400, 296 )
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
position = Vector2( 4, -17 )
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 0.381104, 0.412598 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
7
Pavels/bullet_trajectory/default_env.tres
Normal file
7
Pavels/bullet_trajectory/default_env.tres
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_resource type="Environment" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[sub_resource type="ProceduralSky" id=1]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
background_mode = 2
|
||||||
|
background_sky = SubResource( 1 )
|
||||||
37
Pavels/bullet_trajectory/game.tscn
Normal file
37
Pavels/bullet_trajectory/game.tscn
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
[gd_scene load_steps=6 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
|
||||||
|
[ext_resource path="res://icon.png" type="Texture" id=3]
|
||||||
|
[ext_resource path="res://Gun.gd" type="Script" id=4]
|
||||||
|
[ext_resource path="res://Mob.gd" type="Script" id=5]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
extents = Vector2( 31.7698, 29.9446 )
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Mob" type="KinematicBody2D" parent="." groups=[
|
||||||
|
"mobs",
|
||||||
|
]]
|
||||||
|
position = Vector2( -0.000213623, 0.000244141 )
|
||||||
|
script = ExtResource( 5 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="Mob"]
|
||||||
|
position = Vector2( 748.393, 296.081 )
|
||||||
|
texture = ExtResource( 3 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Mob"]
|
||||||
|
position = Vector2( 748.393, 293.562 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
one_way_collision_margin = 0.0
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource( 1 )]
|
||||||
|
|
||||||
|
[node name="Gun" type="Position2D" parent="Player"]
|
||||||
|
position = Vector2( 37.1728, -6.00076 )
|
||||||
|
script = ExtResource( 4 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="Player/Gun"]
|
||||||
|
position = Vector2( 35, 1 )
|
||||||
|
scale = Vector2( 1, 0.109375 )
|
||||||
|
texture = ExtResource( 3 )
|
||||||
BIN
Pavels/bullet_trajectory/icon.png
Normal file
BIN
Pavels/bullet_trajectory/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
34
Pavels/bullet_trajectory/icon.png.import
Normal file
34
Pavels/bullet_trajectory/icon.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.png"
|
||||||
|
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
BIN
Pavels/bullet_trajectory/pixil-frame-0 (1).png
Normal file
BIN
Pavels/bullet_trajectory/pixil-frame-0 (1).png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
34
Pavels/bullet_trajectory/pixil-frame-0 (1).png.import
Normal file
34
Pavels/bullet_trajectory/pixil-frame-0 (1).png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/pixil-frame-0 (1).png-160dd9969d7e45d14d604c370b40e019.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://pixil-frame-0 (1).png"
|
||||||
|
dest_files=[ "res://.import/pixil-frame-0 (1).png-160dd9969d7e45d14d604c370b40e019.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
BIN
Pavels/bullet_trajectory/pixilart-drawing.png
Normal file
BIN
Pavels/bullet_trajectory/pixilart-drawing.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 818 B |
34
Pavels/bullet_trajectory/pixilart-drawing.png.import
Normal file
34
Pavels/bullet_trajectory/pixilart-drawing.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/pixilart-drawing.png-9e9c431ac86a42d1fefc4da3ac6bc15c.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://pixilart-drawing.png"
|
||||||
|
dest_files=[ "res://.import/pixilart-drawing.png-9e9c431ac86a42d1fefc4da3ac6bc15c.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
||||||
75
Pavels/bullet_trajectory/project.godot
Normal file
75
Pavels/bullet_trajectory/project.godot
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
; 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=4
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Bullet Trajectory"
|
||||||
|
run/main_scene="res://game.tscn"
|
||||||
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
ui_left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_down={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
shoot={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
gun_up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
gun_down={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
sine={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":48,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
line={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":57,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[physics]
|
||||||
|
|
||||||
|
common/enable_pause_aware_picking=true
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
environment/default_environment="res://default_env.tres"
|
||||||
Loading…
Reference in New Issue
Block a user