1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-21 23:34:21 +00:00

Merge and hope for the best

This commit is contained in:
Steffo 2023-01-08 12:39:41 +01:00
commit 0b8b5b37fb
Signed by: steffo
GPG key ID: 6965406171929D01
7 changed files with 53 additions and 41 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
# Godot 4+ specific ignores # Godot 4+ specific ignores
.godot/ .godot/
export_presets.cfg
# Steffo's random assets folder # Steffo's random assets folder
available-assets/ available-assets/

View file

@ -1,29 +0,0 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../../Desktop/ld52/ld52_linux.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=1
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/architecture="x86_64"

View file

@ -1,4 +1,5 @@
extends Node3D extends Node3D
class_name CropTile
signal on_planted() signal on_planted()

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=16 format=3 uid="uid://bg88gc1w1gw5m"] [gd_scene load_steps=17 format=3 uid="uid://bg88gc1w1gw5m"]
[ext_resource type="Shader" path="res://island/Sea.gdshader" id="1_agjfy"] [ext_resource type="Shader" path="res://island/Sea.gdshader" id="1_agjfy"]
[ext_resource type="Texture2D" uid="uid://bdoifsf6k0qb8" path="res://assets/water_tile.png" id="1_w6ara"] [ext_resource type="Texture2D" uid="uid://bdoifsf6k0qb8" path="res://assets/water_tile.png" id="1_w6ara"]
@ -23,15 +23,23 @@ shader_parameter/sea = ExtResource("1_w6ara")
material = SubResource("ShaderMaterial_3uyyi") material = SubResource("ShaderMaterial_3uyyi")
size = Vector2(1000, 1000) size = Vector2(1000, 1000)
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_htlhh"] [sub_resource type="Gradient" id="Gradient_shcpx"]
sky_top_color = Color(0.356863, 0.623529, 0.937255, 1) interpolation_mode = 2
sky_horizon_color = Color(0.254902, 0.623529, 0.8, 1) offsets = PackedFloat32Array(0.518605, 0.723256, 0.953488)
ground_bottom_color = Color(0.254902, 0.623529, 0.8, 1) colors = PackedColorArray(1, 0.694118, 0.741176, 1, 0.0352941, 0.831373, 0.882353, 1, 0.152941, 0.698039, 1, 1)
ground_horizon_color = Color(0.254902, 0.623529, 0.8, 1)
ground_curve = 7.89838 [sub_resource type="GradientTexture2D" id="GradientTexture2D_yb0rj"]
gradient = SubResource("Gradient_shcpx")
width = 256
height = 256
fill_from = Vector2(0, 1)
fill_to = Vector2(0, 0)
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_c0cxy"]
panorama = SubResource("GradientTexture2D_yb0rj")
[sub_resource type="Sky" id="Sky_j6hso"] [sub_resource type="Sky" id="Sky_j6hso"]
sky_material = SubResource("ProceduralSkyMaterial_htlhh") sky_material = SubResource("PanoramaSkyMaterial_c0cxy")
[sub_resource type="Environment" id="Environment_302o8"] [sub_resource type="Environment" id="Environment_302o8"]
background_mode = 2 background_mode = 2
@ -81,10 +89,10 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -27, 0
environment = SubResource("Environment_302o8") environment = SubResource("Environment_302o8")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -0.337161, 0.941447, 0, -0.941447, -0.337161, 0, 2.08989, 0) transform = Transform3D(1, 0, 0, 0, -0.249636, 0.96834, 0, -0.96834, -0.249636, 0, 7.44648, 0)
[node name="Player" parent="." instance=ExtResource("3_5378m")] [node name="Player" parent="." instance=ExtResource("3_5378m")]
transform = Transform3D(-1, 3.48787e-16, -8.74228e-08, 3.48787e-16, 1, -3.48787e-16, 8.74228e-08, -3.48787e-16, -1, 0, 4.89631, 0) transform = Transform3D(-1, 3.48787e-16, -8.74228e-08, 3.48787e-16, 1, -3.48787e-16, 8.74228e-08, -3.48787e-16, -1, 2.08165e-12, 4.896, 2.08165e-12)
[node name="CropTiles" type="Node3D" parent="."] [node name="CropTiles" type="Node3D" parent="."]
@ -97,6 +105,12 @@ debug_growth_offset = 0.5
[node name="CropTile3" parent="CropTiles" instance=ExtResource("8_4ooup")] [node name="CropTile3" parent="CropTiles" instance=ExtResource("8_4ooup")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 8) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 2, 8)
debug_growth = true
debug_growth_offset = 0.6
[node name="CropTile4" parent="CropTiles" instance=ExtResource("8_4ooup")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -2)
debug_growth = true
debug_growth_offset = 0.6 debug_growth_offset = 0.6
[node name="Produce" type="Node3D" parent="."] [node name="Produce" type="Node3D" parent="."]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=5 format=3 uid="uid://bufi0wh54u5x5"] [gd_scene load_steps=4 format=3 uid="uid://bufi0wh54u5x5"]
[ext_resource type="Theme" uid="uid://c5a1nyqumj46j" path="res://menu/menu_theme.tres" id="1_mkxnc"] [ext_resource type="Theme" uid="uid://c5a1nyqumj46j" path="res://menu/menu_theme.tres" id="1_mkxnc"]
[ext_resource type="Script" path="res://menu/Menu.gd" id="2_6amk3"] [ext_resource type="Script" path="res://menu/Menu.gd" id="2_6amk3"]

View file

@ -6,6 +6,7 @@ var last_fired := 0
var remaining := 10 var remaining := 10
@onready var ray = $RayCast3D @onready var ray = $RayCast3D
var croptile = preload("res://island/CropTile.tscn")
func _init() -> void: func _init() -> void:
@ -37,6 +38,7 @@ func shoot() -> void:
var normal = ray.get_collision_normal() as Vector3 var normal = ray.get_collision_normal() as Vector3
var point = ray.get_collision_point() as Vector3 var point = ray.get_collision_point() as Vector3
var object = ray.get_collider() as Node3D var object = ray.get_collider() as Node3D
try_placing_seed(ray)
# decalInstance.position = point # decalInstance.position = point
# object.add_child(decalInstance) # object.add_child(decalInstance)
else: else:
@ -44,3 +46,21 @@ func shoot() -> void:
pass pass
remaining -= 1 remaining -= 1
func try_placing_seed(ray: RayCast3D) -> bool:
var point = ray.get_collision_point() as Vector3
var normal = ray.get_collision_normal() as Vector3
var obj = ray.get_collider() as Node3D
print(point, normal, obj.name)
if normal != Vector3(0,1,0):
print("Not horizontal, no plant for you :<")
return false
var correct_point = point.floor()
var crop = croptile.instantiate() as CropTile
crop.position = correct_point
crop.debug_growth = true
get_tree().root.add_child(crop)
return true

View file

@ -14,6 +14,11 @@ _global_script_classes=[{
"language": &"GDScript", "language": &"GDScript",
"path": "res://player/onhand/BaseWeapon.gd" "path": "res://player/onhand/BaseWeapon.gd"
}, { }, {
"base": "Node3D",
"class": &"CropTile",
"language": &"GDScript",
"path": "res://island/CropTile.gd"
}, {
"base": "BaseWeapon", "base": "BaseWeapon",
"class": &"PeaShooter", "class": &"PeaShooter",
"language": &"GDScript", "language": &"GDScript",
@ -31,6 +36,7 @@ _global_script_classes=[{
}] }]
_global_script_class_icons={ _global_script_class_icons={
"BaseWeapon": "", "BaseWeapon": "",
"CropTile": "",
"PeaShooter": "", "PeaShooter": "",
"Player": "", "Player": "",
"PlayerInputData": "" "PlayerInputData": ""
@ -115,5 +121,4 @@ fire={
[rendering] [rendering]
renderer/rendering_method="gl_compatibility"
environment/defaults/default_clear_color=Color(0.231373, 0.490196, 0.309804, 1) environment/defaults/default_clear_color=Color(0.231373, 0.490196, 0.309804, 1)