changed sg sprite to work better with palettes

This commit is contained in:
pennyrigate 2023-06-02 18:03:44 -04:00
parent 463b7952b1
commit a5f4c34236
34 changed files with 356 additions and 9 deletions

View file

@ -26,6 +26,7 @@ var is_easy_mode = false
var easy_mode_speed_factor = 0.75
var use_lives = false
var can_pause = true
var current_palette = "default"
func _ready():
Save.load_file(current_file)

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/file_select_arrow.png-c4dd38af48f940ca232cee7aab98deca.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/hud/file_select_arrow.png"
dest_files=[ "res://.import/file_select_arrow.png-c4dd38af48f940ca232cee7aab98deca.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.3 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

View file

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/pal_purplearmor.png-4be1df2c9bcaa98882b0b62f01cb851a.stex"
path="res://.import/default.png-6df0b18cbcfa2be3c1e686686b6905e6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/player/pal_purplearmor.png"
dest_files=[ "res://.import/pal_purplearmor.png-4be1df2c9bcaa98882b0b62f01cb851a.stex" ]
source_file="res://graphics/player/palettes/default.png"
dest_files=[ "res://.import/default.png-6df0b18cbcfa2be3c1e686686b6905e6.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/msx.png-afd8ff86bb458e4177e0aa622ca7db04.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/player/palettes/msx.png"
dest_files=[ "res://.import/msx.png-afd8ff86bb458e4177e0aa622ca7db04.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.

After

Width:  |  Height:  |  Size: 179 B

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/strawberry.png-3a39f091919ee3d7a564aa066e171830.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://graphics/player/palettes/strawberry.png"
dest_files=[ "res://.import/strawberry.png-3a39f091919ee3d7a564aa066e171830.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: 338 B

After

Width:  |  Height:  |  Size: 344 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 B

After

Width:  |  Height:  |  Size: 440 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 344 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 365 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 361 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 293 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

After

Width:  |  Height:  |  Size: 305 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 460 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 311 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 493 B

After

Width:  |  Height:  |  Size: 497 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 380 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 297 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 435 B

Before After
Before After

19
menus/cool.tscn Normal file
View file

@ -0,0 +1,19 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/color_1 = Color( 0.145098, 0.0823529, 0.0823529, 1 )
shader_param/color_2 = Color( 1, 0, 0, 1 )
shader_param/checker_size = Vector2( 16, 16 )
shader_param/cycle_speed = Vector2( -8, 0 )
shader_param/pan_speed = Vector2( 0, 8 )
shader_param/uv_transform = Transform2D( 1, 0, 1, 4, 0, 0 )
[node name="Node2D" type="Node2D"]
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource( 1 )
margin_right = 256.0
margin_bottom = 192.0

16
menus/file_select.gd Normal file
View file

@ -0,0 +1,16 @@
extends Node
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass

83
menus/file_select.tscn Normal file
View file

@ -0,0 +1,83 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://menus/file_select_panel.tscn" type="PackedScene" id=1]
[ext_resource path="res://graphics/borders/skaborder.png" type="Texture" id=8]
[ext_resource path="res://graphics/hud/file_select_arrow.png" type="Texture" id=9]
[ext_resource path="res://menus/file_select.gd" type="Script" id=10]
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=11]
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 11 )
shader_param/color_1 = Color( 0.2, 0.294118, 1, 1 )
shader_param/color_2 = Color( 0, 0.0352941, 0.329412, 1 )
shader_param/checker_size = Vector2( 16, 16 )
shader_param/cycle_speed = Vector2( 0, 16 )
shader_param/pan_speed = Vector2( 0, 0 )
shader_param/uv_transform = Transform2D( 2, 0, 2, 1, 0, 0 )
[node name="FileSelect" type="Node"]
script = ExtResource( 10 )
[node name="TextureRect2" type="TextureRect" parent="."]
visible = false
modulate = Color( 0, 0.109804, 1, 1 )
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 8 )
expand = true
stretch_mode = 2
[node name="ColorRect" type="ColorRect" parent="."]
material = SubResource( 2 )
margin_right = 256.0
margin_bottom = 192.0
[node name="Panel" parent="." instance=ExtResource( 1 )]
margin_left = 12.0
margin_top = 64.0
margin_right = 84.0
margin_bottom = 128.0
[node name="Panel2" parent="." instance=ExtResource( 1 )]
margin_left = 92.0
margin_top = 64.0
margin_right = 164.0
margin_bottom = 128.0
number = 2
[node name="Panel3" parent="." instance=ExtResource( 1 )]
margin_left = 172.0
margin_top = 64.0
margin_right = 244.0
margin_bottom = 128.0
number = 3
[node name="SelectFile1" type="TextureButton" parent="."]
margin_left = 12.0
margin_top = 130.0
margin_right = 84.0
margin_bottom = 138.0
texture_normal = ExtResource( 9 )
texture_focused = ExtResource( 9 )
expand = true
stretch_mode = 3
[node name="SelectFile2" type="TextureButton" parent="."]
margin_left = 92.0
margin_top = 130.0
margin_right = 164.0
margin_bottom = 138.0
texture_normal = ExtResource( 9 )
texture_focused = ExtResource( 9 )
expand = true
stretch_mode = 3
[node name="SelectFile3" type="TextureButton" parent="."]
margin_left = 172.0
margin_top = 130.0
margin_right = 244.0
margin_bottom = 138.0
texture_normal = ExtResource( 9 )
texture_focused = ExtResource( 9 )
expand = true
stretch_mode = 3

View file

@ -0,0 +1,12 @@
extends Panel
export var number = 1
func _ready():
var file = File.new()
if !file.file_exists("user://file" + str(number) + ".pr"):
$FileExists.visible = false
$FileDoesNotExist.visible = true
else:
#Fill out info
pass

View file

@ -0,0 +1,91 @@
[gd_scene load_steps=10 format=2]
[ext_resource path="res://shaders/recolor_border.shader" type="Shader" id=1]
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=2]
[ext_resource path="res://objects/collectibles/key.tscn" type="PackedScene" id=3]
[ext_resource path="res://ui/theme.tres" type="Theme" id=4]
[ext_resource path="res://objects/collectibles/shard.tscn" type="PackedScene" id=5]
[ext_resource path="res://menus/file_select_panel.gd" type="Script" id=6]
[ext_resource path="res://graphics/player/sg_idle.png" type="Texture" id=8]
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=9]
[sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 1 )
shader_param/border_color = Color( 0, 0, 0, 1 )
shader_param/border_corners = true
shader_param/palette = ExtResource( 9 )
[node name="Panel" type="Panel"]
margin_right = 72.0
margin_bottom = 64.0
theme = ExtResource( 4 )
script = ExtResource( 6 )
__meta__ = {
"_edit_group_": true
}
[node name="FileNumber" type="Label" parent="."]
material = ExtResource( 2 )
margin_top = -10.0
margin_right = 72.0
theme = ExtResource( 4 )
text = "file1"
align = 1
[node name="FileExists" type="Node2D" parent="."]
[node name="Name" type="Label" parent="FileExists"]
margin_left = 8.0
margin_top = 4.0
margin_right = 64.0
margin_bottom = 14.0
text = "SG"
align = 1
[node name="TimeCounter" type="Label" parent="FileExists"]
margin_left = 3.0
margin_top = 50.0
margin_right = 69.0
margin_bottom = 60.0
text = "00:00"
align = 1
[node name="Palette" type="TextureRect" parent="FileExists"]
material = SubResource( 1 )
margin_left = 8.0
margin_top = 16.0
margin_right = 28.0
margin_bottom = 48.0
texture = ExtResource( 8 )
stretch_mode = 4
[node name="ShardCounter" type="Label" parent="FileExists"]
margin_left = 43.0
margin_top = 20.0
margin_right = 67.0
margin_bottom = 30.0
text = "00"
[node name="KeyCounter" type="Label" parent="FileExists"]
margin_left = 43.0
margin_top = 33.0
margin_right = 64.0
margin_bottom = 43.0
text = "000"
[node name="Shard" parent="FileExists" instance=ExtResource( 5 )]
position = Vector2( 32, 23 )
[node name="Key" parent="FileExists" instance=ExtResource( 3 )]
position = Vector2( 32, 34 )
[node name="FileDoesNotExist" type="Node2D" parent="."]
visible = false
[node name="Label" type="Label" parent="FileDoesNotExist"]
margin_left = 3.0
margin_top = 26.0
margin_right = 69.0
margin_bottom = 36.0
text = "Empty!!!"
align = 1

View file

@ -13,3 +13,4 @@ func _ready():
continue_button.visible = false
$Panel/FileSelect.grab_focus()
Vector2( 0.83205, 0.5547 )

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://ui/theme.tres" type="Theme" id=1]
[ext_resource path="res://graphics/hud/sg_menu.png" type="Texture" id=3]
@ -8,13 +8,22 @@
[sub_resource type="ShaderMaterial" id=2]
shader = ExtResource( 6 )
shader_param/color_1 = Color( 0.952941, 0.952941, 0.952941, 1 )
shader_param/color_2 = Color( 0.137255, 0.137255, 0.137255, 1 )
shader_param/color_1 = Color( 1, 0.835294, 0.619608, 1 )
shader_param/color_2 = Color( 1, 0.478431, 0.219608, 1 )
shader_param/checker_size = Vector2( 16, 16 )
shader_param/cycle_speed = Vector2( 12, 0 )
shader_param/pan_speed = Vector2( 0, 0 )
shader_param/uv_transform = Transform( 1, -2, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0 )
[sub_resource type="ShaderMaterial" id=3]
shader = ExtResource( 6 )
shader_param/color_1 = Color( 0.62, 0.797333, 1, 1 )
shader_param/color_2 = Color( 0.22, 0.428, 1, 1 )
shader_param/checker_size = Vector2( 16, 16 )
shader_param/cycle_speed = Vector2( 24, 0 )
shader_param/pan_speed = Vector2( 0, 0 )
shader_param/uv_transform = Transform( 1, 1, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="MainMenu" type="Node"]
script = ExtResource( 5 )
@ -22,6 +31,13 @@ script = ExtResource( 5 )
material = SubResource( 2 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 136.0
[node name="Background2" type="ColorRect" parent="."]
material = SubResource( 3 )
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = -56.0
[node name="TextureRect2" type="TextureRect" parent="."]
margin_left = 176.0
@ -60,7 +76,7 @@ margin_left = 8.0
margin_top = 9.0
margin_right = 16.0
margin_bottom = 17.0
focus_neighbour_top = NodePath("../Augmentations")
focus_neighbour_top = NodePath("../Options")
focus_neighbour_bottom = NodePath("../FileSelect")
texture_focused = ExtResource( 4 )

View file

@ -54,6 +54,9 @@ onready var pushable_detector: RayCast2D = $"%PushableDetector"
# OVERRIDES #
func _ready() -> void:
#set palette
var palette = load("res://graphics/player/palettes/%s.png" % Game.current_palette)
sprite.material.set_shader_param("palette", palette)
# death handling
Game.respawn_point = global_position
connect("died", Game, "_on_player_died")

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=43 format=2]
[ext_resource path="res://objects/player/player.gd" type="Script" id=1]
[ext_resource path="res://graphics/player/pal_purplearmor.png" type="Texture" id=2]
[ext_resource path="res://graphics/player/palettes/default.png" type="Texture" id=2]
[ext_resource path="res://shaders/recolor_border.shader" type="Shader" id=3]
[ext_resource path="res://graphics/player/sg_idle.png" type="Texture" id=4]
[ext_resource path="res://addons/godot_state_charts/parallel_state.gd" type="Script" id=5]
@ -1174,8 +1174,8 @@ script = ExtResource( 8 )
[connection signal="state_physics_processing" from="StateChart/Root/Movement" to="." method="_process_movement"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded" to="." method="_on_Grounded_state_entered"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded" to="." method="_process_grounded"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_horizontal_movement_grounded"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/CanWalk" to="." method="_process_can_walk"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Still" to="." method="_on_Still_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Walking" to="." method="_on_Walking_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/CanWalk/Blinking" to="." method="_on_Blinking_state_entered"]