Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wybór wyglądu gracza #266

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Assets/Hero/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/1.png-d1f6badde5a4c680b0c0135f6558dc2d.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/1.png"
dest_files=[ "res://.import/1.png-d1f6badde5a4c680b0c0135f6558dc2d.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Assets/Hero/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/2.png-3c0dba2b9818011229c4f89395923310.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/2.png"
dest_files=[ "res://.import/2.png-3c0dba2b9818011229c4f89395923310.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Assets/Hero/Hero0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/Hero0.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Hero0.png-3d0c21abfdb9ebfa5095f2e373bc2d4d.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/Hero0.png"
dest_files=[ "res://.import/Hero0.png-3d0c21abfdb9ebfa5095f2e373bc2d4d.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Assets/Hero/Hero1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/Hero1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Hero1.png-1f84cb387534816874b7623f2a0ac9d7.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/Hero1.png"
dest_files=[ "res://.import/Hero1.png-1f84cb387534816874b7623f2a0ac9d7.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Assets/Hero/Hero2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/Hero2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Hero2.png-acd5ee50d220993f56fbab97dbace207.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/Hero2.png"
dest_files=[ "res://.import/Hero2.png-acd5ee50d220993f56fbab97dbace207.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added Assets/Hero/Hero3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Assets/Hero/Hero3.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/Hero3.png-56fdcde37adbf04578b70b51aa48f8d8.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/Hero/Hero3.png"
dest_files=[ "res://.import/Hero3.png-56fdcde37adbf04578b70b51aa48f8d8.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
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
17 changes: 15 additions & 2 deletions Scenes/Actors/Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var chest = null #Zmienna określająca czy gracz stoi przy skrzyni
var level #przypisanie sceny głównej
var all_weapons = {} #wszystkie bronki
var weapons = {} #posiadane bronki
var current_weapon = 1;
var current_weapon = 1
var first_weapon_stats = {"attack":float(12), "knc":float(0.15)}
var second_weapon_stats = {}

Expand Down Expand Up @@ -59,6 +59,9 @@ var skok = false
var skok_vector = Vector2.DOWN
var stamina = 3

# === WYGLAD GRACZA === #
var tekstury = [0, 0, 0]

# === ZMIENNE DO KNOCKBACKU === #
var knockback = Vector2.ZERO
var knockbackResistance = 1 # rezystancja knockbacku zakres -> (0.6-nieskończoność), poniżej 0.6 przeciwnicy za daleko odlatują
Expand Down Expand Up @@ -164,7 +167,9 @@ func _ready(): #po inicjacji bohatera
"60healthPotion" : 0,
"Empty" : 0
}
UpdatePotions()
UpdatePotions()
if Bufor.tekstury != null:
aktulizujSkorki()


func _process(delta):
Expand Down Expand Up @@ -600,3 +605,11 @@ func on_skill_used(ability,mana_used):
$CoolDownS3.start(25)
else:
$CoolDownS4.start(50)

func aktulizujSkorki():
if Bufor.tekstury != null:
tekstury = Bufor.tekstury
if tekstury[0] >= 0:
$PlayerSprite.texture = load("res://Assets/Hero/Hero" + str(tekstury[0]) + ".png")
$PlayerSprite/x1.frame = tekstury[1]
$PlayerSprite/x2.frame = tekstury[2]
31 changes: 28 additions & 3 deletions Scenes/Actors/Player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=36 format=2]
[gd_scene load_steps=38 format=2]

[ext_resource path="res://Assets/Hero/RedHero.png" type="Texture" id=1]
[ext_resource path="res://Scenes/Actors/Player.gd" type="Script" id=2]
Expand All @@ -7,6 +7,8 @@
[ext_resource path="res://Scenes/title_screen/music/projekt_8bit.ogg" type="AudioStream" id=5]
[ext_resource path="res://Assets/Enemies/shadow.png" type="Texture" id=6]
[ext_resource path="res://Assets/Light/Light.tscn" type="PackedScene" id=7]
[ext_resource path="res://Assets/Hero/1.png" type="Texture" id=8]
[ext_resource path="res://Assets/Hero/2.png" type="Texture" id=9]

[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.794702, 1 )
Expand Down Expand Up @@ -102,6 +104,18 @@ tracks/0/keys = {
"update": 1,
"values": [ 1, 2, 3, 4, 5, 6, 7 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("PlayerSprite/x1:position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6 ),
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
"update": 1,
"values": [ Vector2( 0, 0 ), Vector2( 0, 1 ), Vector2( 0, 0 ), Vector2( 0, -1 ), Vector2( 0, -2 ), Vector2( 0, -1 ), Vector2( 0, 0 ) ]
}

[sub_resource type="Animation" id=14]
resource_name = "skok"
Expand Down Expand Up @@ -192,7 +206,9 @@ color_ramp = SubResource( 24 )
[sub_resource type="OccluderPolygon2D" id=28]
polygon = PoolVector2Array( -5, -4, 5, -4, 5, 9, -5, 9 )

[node name="Player" type="KinematicBody2D" groups=["Player"]]
[node name="Player" type="KinematicBody2D" groups=[
"Player",
]]
collision_mask = 6
script = ExtResource( 2 )

Expand All @@ -214,7 +230,16 @@ position = Vector2( 0, -4 )
scale = Vector2( 1.5, 1.5 )
texture = ExtResource( 1 )
hframes = 9
frame = 8
frame = 7

[node name="x1" type="Sprite" parent="PlayerSprite"]
texture = ExtResource( 8 )
hframes = 3

[node name="x2" type="Sprite" parent="PlayerSprite"]
show_behind_parent = true
texture = ExtResource( 9 )
hframes = 3

[node name="PlayerCollision" type="CollisionShape2D" parent="."]
position = Vector2( 0, 7.109 )
Expand Down
16 changes: 0 additions & 16 deletions Scenes/Levels/Spawning_enemies.gd
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,6 @@ func _on_Node2D_body_entered(body): #Funkcja,która się aktywuje po wejsciu w k
call_deferred("add_child",bossIns) #dodawanie sceny boss'a
bossIns.connect("died", self, "open") #polaczenie sygnalu ktory otwiera drzwi po zabiciu bossa
close_door() #zamkniecie drzwi
elif is_sklep:
if odwiedzony == false:
weapon()
potion()
var popup = load("res://Scenes/UI/Sklep_ceny.tscn")
popup = popup.instance()
popup.rect_scale.x = 0.5
popup.rect_scale.y = 0.5
call_deferred("add_child", popup)
popups[body] = popup
odwiedzony = true
Bufor.in_sklep = true
elif is_sklep == false:
if body in popups:
popups[body].call_deferred('free')
Bufor.in_sklep = false
id_list.append(current_id)
if body.is_in_group("Enemy"): #zamykanie drzwi po wejsciu do pokoju
close_door()
Expand Down
Loading