more cave stuff

This commit is contained in:
pennyrigate 2023-11-29 19:10:21 -05:00
parent 27c08c8e4e
commit b54f7e986c
9 changed files with 158 additions and 37 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/cave_scholar.png-5daab0741db98d8c70cedb3ef3dbd7f3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/backgrounds/cave_scholar.png"
dest_files=[ "res://.import/cave_scholar.png-5daab0741db98d8c70cedb3ef3dbd7f3.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=false
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
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

@ -13,7 +13,7 @@
[resource]
frames = 10
fps = 10.0
fps = 9.0
frame_0/texture = ExtResource( 5 )
frame_1/texture = ExtResource( 6 )
frame_1/delay_sec = 0.0

View file

@ -13,7 +13,7 @@
[resource]
frames = 10
fps = 10.0
fps = 9.0
frame_0/texture = ExtResource( 2 )
frame_1/texture = ExtResource( 6 )
frame_1/delay_sec = 0.0

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=32 format=2]
[ext_resource path="res://tilesets/t_death.tres" type="TileSet" id=1]
[ext_resource path="res://tilesets/t_cave.tres" type="TileSet" id=2]
[ext_resource path="res://tilesets/t_mountain.tres" type="TileSet" id=3]
[ext_resource path="res://objects/hud/hud.tscn" type="PackedScene" id=4]
[ext_resource path="res://objects/enemy/roboturret.tscn" type="PackedScene" id=5]
@ -27,6 +26,7 @@
[ext_resource path="res://objects/enemy/cop.tscn" type="PackedScene" id=25]
[ext_resource path="res://objects/environment/turret/turret_bullet.tscn" type="PackedScene" id=26]
[ext_resource path="res://objects/player/player.tscn" type="PackedScene" id=27]
[ext_resource path="res://tilesets/t_ladders.tres" type="TileSet" id=28]
[sub_resource type="ShaderMaterial" id=4]
shader = ExtResource( 17 )
@ -83,7 +83,7 @@ position = Vector2( 264, 160 )
position = Vector2( 104, 120 )
[node name="Ladder" type="TileMap" parent="."]
tile_set = ExtResource( 2 )
tile_set = ExtResource( 28 )
cell_size = Vector2( 8, 8 )
collision_layer = 9
format = 1
@ -116,17 +116,12 @@ position = Vector2( 32, 72 )
up_boundary = 3.0
down_boundary = 3.0
[node name="Tin3" parent="." instance=ExtResource( 20 )]
position = Vector2( 96, 72 )
up_boundary = 3.0
down_boundary = 3.0
move_direction = 1
[node name="RollingFiend" parent="." instance=ExtResource( 22 )]
position = Vector2( 48, 120 )
[node name="AnimatedSprite" parent="RollingFiend" index="0"]
visible = false
frame = 1
[node name="SawTest2" type="AnimatedSprite" parent="RollingFiend"]
material = SubResource( 4 )

View file

@ -0,0 +1,20 @@
extends ParallaxBackground
func revert_offset(layer: ParallaxLayer) -> void:
# Cancel out layer's offset. The layer's position already has
# its motion_scale applied.
var ofs := scroll_offset - layer.position
if not scroll_ignore_camera_zoom:
# When attention is given to the camera's zoom, we need to account for it.
# We can use viewport's canvas transform scale to which the camera has
# already applied its zoom.
var canvas_scale = get_viewport().canvas_transform.get_scale()
# This is taken from godot source: parallax_background.cpp
# I don't know why it works.
ofs /= canvas_scale.dot(Vector2(0.5, 0.5))
layer.motion_offset = ofs
func _ready() -> void:
for layer in get_children():
if layer is ParallaxLayer:
revert_offset(layer)

View file

@ -16,7 +16,7 @@ points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
points = PoolVector2Array( 8, 8, 0, 8, 0, 0, 8, 0 )
[sub_resource type="ConvexPolygonShape2D" id=27]
points = PoolVector2Array( 8, 2, 0, 2, 0, 2, 8, 2 )
points = PoolVector2Array( 8, 0, 0, 0, 0, 0, 8, 0 )
[sub_resource type="ConvexPolygonShape2D" id=5]
points = PoolVector2Array( 0, 0, 8, 0, 8, 8, 0, 8 )