From 431fb8220e85c06632cb57a2b67390eccd75c16d Mon Sep 17 00:00:00 2001 From: megamichi Date: Fri, 18 Oct 2024 16:34:51 +0200 Subject: [PATCH] - implementing biom change - fixing typo in "highscore" --- assets/Ground/{normal.png => n.png} | Bin .../{normal.png.import => n.png.import} | 6 +- assets/Ground/n_w.png | Bin 0 -> 5547 bytes ...ormal_wueste.png.import => n_w.png.import} | 6 +- assets/Ground/normal_wueste.png | Bin 5608 -> 0 bytes assets/Ground/w.png | Bin 0 -> 2531 bytes .../{wueste.png.import => w.png.import} | 6 +- assets/Ground/w_n.png | Bin 0 -> 5480 bytes assets/Ground/w_n.png.import | 34 ++++++ assets/Ground/wueste.png | Bin 2576 -> 0 bytes code/GUI/gui.gd | 2 - code/GUI/restartschild.gd | 7 +- code/global.gd | 31 +++-- code/hiscore.gd | 9 +- code/main.gd | 16 +-- code/score.gd | 14 +++ scenes/Duck/Duck.gd | 8 +- scenes/Main.tscn | 114 +++++++++--------- scenes/Wolke/wolke.gd | 1 + scenes/ground/ground.gd | 19 +++ scenes/ground/ground.tscn | 17 +++ scenes/ground/spawner/ground_spawner.gd | 51 ++++++++ scenes/hindernis/Spawner/hindernis_spawner.gd | 4 +- scenes/hindernis/hindernis.gd | 2 + 24 files changed, 242 insertions(+), 105 deletions(-) rename assets/Ground/{normal.png => n.png} (100%) rename assets/Ground/{normal.png.import => n.png.import} (72%) create mode 100644 assets/Ground/n_w.png rename assets/Ground/{normal_wueste.png.import => n_w.png.import} (70%) delete mode 100644 assets/Ground/normal_wueste.png create mode 100644 assets/Ground/w.png rename assets/Ground/{wueste.png.import => w.png.import} (72%) create mode 100644 assets/Ground/w_n.png create mode 100644 assets/Ground/w_n.png.import delete mode 100644 assets/Ground/wueste.png create mode 100644 code/score.gd create mode 100644 scenes/ground/ground.gd create mode 100644 scenes/ground/ground.tscn create mode 100644 scenes/ground/spawner/ground_spawner.gd diff --git a/assets/Ground/normal.png b/assets/Ground/n.png similarity index 100% rename from assets/Ground/normal.png rename to assets/Ground/n.png diff --git a/assets/Ground/normal.png.import b/assets/Ground/n.png.import similarity index 72% rename from assets/Ground/normal.png.import rename to assets/Ground/n.png.import index 3b9d619..dd22f9b 100644 --- a/assets/Ground/normal.png.import +++ b/assets/Ground/n.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bg78j6xxw3ck4" -path="res://.godot/imported/normal.png-37b1636db5b68b29e796c7291d1e7fb7.ctex" +path="res://.godot/imported/n.png-e0925980109603d0618d5083d12d13a4.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/Ground/normal.png" -dest_files=["res://.godot/imported/normal.png-37b1636db5b68b29e796c7291d1e7fb7.ctex"] +source_file="res://assets/Ground/n.png" +dest_files=["res://.godot/imported/n.png-e0925980109603d0618d5083d12d13a4.ctex"] [params] diff --git a/assets/Ground/n_w.png b/assets/Ground/n_w.png new file mode 100644 index 0000000000000000000000000000000000000000..d55e0d8222ffd2018ec7e3f523c9cb841c84fd2b GIT binary patch literal 5547 zcmd6L^;;9}_x=VWhUDm;b972d$s|YDKsp6!bfAdjKqREg0n*YP0|^O{lI{)>K?!LP zaqQ#k{nPhP_&(Ql&UNnlJU=|=I`+B;D0xWOJ%xJ$ZO9mc4uy!L;=Nx3?SYBy z{$UgRlB2t^z${y7lb8?Kp_*9CLl7N8Sz}U2au}QX9Jryed)({ zyZImkSO>Eh+33eIm83hto8m%W1drv8UuiMJL$=yBPuO?Ddx^#=vwzMgKE;{~`_)bL zRJpo;p8iZ{IxS!~_@N5Dwpo?#QT5E==98hmoyE5NC>^{mng>Z+kpCL;r3|KBsUI83 za4?|sw>QBK_Ex0^!Xn3Hh#_4(jv(|LdRPCQd7sS?OS~%9jK50?dX8~fZSG3+Y7Zd# zore+ncu*@9wrDW5=Ouy$QF;n0 z%-z@L4wHJ8-T|bh#vBtl*9La9mo~P9jyL_e1{(FCGffo=>j41zO)a$ts2A@JR+Zxz z=NY@dHZDwh(|yve(yeDGhcKfMbgk$#rk4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G`X4k$KV0zoKJd3K@owY7{vG4>*BmIHaPj$AmTxtM{9t6xedP4!J+)$F6 zCtf+P9x%(d3j1E$ZjS@bMf6~-#R&kwx~Lv3>wQ9#86cqOd7J&d6Hxu@nyWoSYTz3!si&WVt*^uI$)v(iLnBK8!MNZ z337ijOAuGPBq|nQHXi~f&@fuQ;^$U*ky?h=rTnUmxfR&@*?2RTtR}}{R#2+sbR;Ia zCc2taQ?4u@+%?K&Rrpt|_R5eu*~jEQq7bPaQtx8DgGO{8j5&)Y$RvL61ZJutDINF@tpqngC{yr56uC?V+*Ww~0n8o5y*2rqK8K$1BhEn{0zz&A6nu@7m;~*T{6H@*3 zM1KQJtmTKFuK&^xYR?Io__y|~ujUW}LZsII_ULDXKQ6j58uduw?(B4uw9RBg2kO6~x4<4CvvX8@hiGAd;x*Y@Iq(@f`q?>i}#d6*I94 z286Zp-nq}7*>Oqh!e9xsh`rz#M<-=!o){(}rN%#{JM5pT(>ZiI=?$ek~ny}{K{%;pqbWrJ2k$!l)P9Z>ZzWoEP?#7 zuyh{3+5n*-orz5tuUn6Y1?mz!Y_>F}mO_hMWUMy7{{@BS=ee^cTtE-7pCN+!b- zBK*7B=xe{f2IdywM8fV<_?*Xr>6qeaRg;IdMd`~lU-fipY$2`hG-n(A&~W+O@HB_Z ztD_{{aj;6Fs-`>9<-fDJPz9(hz%}Cmr`wNx*8!a+x&Ro>Ui)6%a4ZmY1GFa4{paIO MQ%w(5sbU}bUsz)+m;e9( diff --git a/assets/Ground/w.png b/assets/Ground/w.png new file mode 100644 index 0000000000000000000000000000000000000000..250c6b1da4528b0c4613026c1a732edbf63dc3e8 GIT binary patch literal 2531 zcmc(gi93{QAIG1u3|WV$kj#-}jmU18qL?szAz89cRFYF^GO|v?c^>bn>%7TtqiQ>={q_rBaM+nVd+k!V8kH!g)w636tl+qLG*<`OVl)neGSV_c=l zxF&&4iM%g8mZ7_tYjf~Nirvbq|mr3__+Zg-W zal7TX(WCrihNig0h(M!Jb#k zD5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QQ4yiawJeV!0mowjOJ z+DN{$Ta21OMjGb`WIvxn_B00F^E=JoikJyz5d?p=WAM~j*P&c|X%O@|0 z{%^Toj$YraD2$DE$t2`_9n#dfd)CI6>*TA%=G90wH)SdKKG@eD8GMjoc%SW;IW^P{ zUs((Xol0Q|Qi&euAg+^7>(;cLIg*w`flds~H_&Y`4&Da86_MVW{Gsn|9L11FET&s& zr1TlYVdjIt!KXmDeg=a^f4wQG(b?C9LI}U+6!9O0<697A`p|u|91By}^*nwZ`18X3 zp@$>M2Ekn7H~Hj%$jY)>;`H+y@;Ws%}U?#kGqSLrjw#HZRW%ycXeLvZV~{ zV6cLkP-h=lhz3ZgEmXLuy@jp8Ih#2}D{PNSNcbll$-4n<)A literal 0 HcmV?d00001 diff --git a/assets/Ground/wueste.png.import b/assets/Ground/w.png.import similarity index 72% rename from assets/Ground/wueste.png.import rename to assets/Ground/w.png.import index 5fc235d..ea06935 100644 --- a/assets/Ground/wueste.png.import +++ b/assets/Ground/w.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bc586lwyvhc0x" -path="res://.godot/imported/wueste.png-5ab8ec82be959612090d314f1b3048a9.ctex" +path="res://.godot/imported/w.png-eaecb02b75e3caf6be524da31509ca22.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/Ground/wueste.png" -dest_files=["res://.godot/imported/wueste.png-5ab8ec82be959612090d314f1b3048a9.ctex"] +source_file="res://assets/Ground/w.png" +dest_files=["res://.godot/imported/w.png-eaecb02b75e3caf6be524da31509ca22.ctex"] [params] diff --git a/assets/Ground/w_n.png b/assets/Ground/w_n.png new file mode 100644 index 0000000000000000000000000000000000000000..f030197383b93d52628b3d4186d45fde71f4aea1 GIT binary patch literal 5480 zcmd5=`8U+x|9@FSWC+PRS+Z}T$TpD-vTtL_nsrRJP$o>WWG4(oB1_4Li5csVowDz{ zklmQb7BOG%&*!|)`F{U{?>*<Z za^8jLXwMOfpYG-7W2C2+ma(pu7TDL{$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-HnTw;{)&iY>2dBjX)UDVWKR0Gx#Yefw!Y}*bzqPd6GZbJL;JY|B+L_ zKGXg7`+to90PATFYC72(lU&YMkli#7 zdWax39Y}Ov8KxMvG;ti%^@i`1KeT5Y1pay{fTp;^hsSpQlJ#%_xghxu*S!m0MC)U; zo;P>Z9P67}{=K`%cPWpS!j!eWKhiRsIr20Rnu?TS1$TAE!AFOfuTMLq2prm^htink zJ#=Zu#igL!;6|6fHP(q4b3)5BZnjxo^)FL1sL_DHgaPf5V;3#7<(7uf1Vzmq!KjjwHgFW`nGEGBxS}mNqN7rmr=u=o}qD2O$)_KMRw*zAC zk;3EBeFttN!HFY-@lsV7+Nvrut`@EqPx=_vt$lO-=YvCrS)F(`|H+G>u4Zxls8qL} zF@}-2mEAAK?oL4xOMnTzjyItF^wAR`&e)8J1iAO9z!H}IzgU{mq!W)G? zc!1dQqZ+lgw(wZj!MvSPZ!F5-w#sz3>Yd*oRkoD?5hsTO4i{?!w#x!C%Z)xY&1VPm zTdP45MmDki?D|iD3v|rTS0QTtqm(FF8~n+6?FALD#y!@5!UE>J%!~p|Y+K?1v66cx z?*~SkLzNtFQ5F_*X~$~1zd;io867WSraH`2&NCD`J!~~Z=E}$KV2UhKZcM>CZ*t}7 zm4byKrU~{CoOc1!V@Ho|NNbxbE^Qdu8pVs)JM#Z*th2)*WLn++n z^oaa3NzY*DkgO&}v=gl5&zSCznajuLuKMU=+ILI-_Lonh`qaJQX5p}2#Dg+in1 z?ggQsxwVv{i{n@3nd@0U5j4wqjYH20rNDM2-0Oc!Y+&ec*UH;~B@180!@AKUjaL&j V)r!zMkAHs8bhQode%5r1_#dS5Mmqoi literal 0 HcmV?d00001 diff --git a/assets/Ground/w_n.png.import b/assets/Ground/w_n.png.import new file mode 100644 index 0000000..6f06ac1 --- /dev/null +++ b/assets/Ground/w_n.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bvel70kpfhdyx" +path="res://.godot/imported/w_n.png-5b7c970c02b0839cd9da18edab137348.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/Ground/w_n.png" +dest_files=["res://.godot/imported/w_n.png-5b7c970c02b0839cd9da18edab137348.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/Ground/wueste.png b/assets/Ground/wueste.png deleted file mode 100644 index 26a9ad129eaf2ea16279c5db8f41d146932230b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2576 zcmc(hdpK0<9>>>=Ye=I|YCEP}D%X(h&Xlo{+>%>tlR8Z0G8rZ`gAode!6C{e*LIQI z8oMyAEi@i?E$e%=6ZBqcn>*s>M%%S()7 z@tIQbYY2%>`<#V>LrKp>%>O`KiFKAetG1CMOfTnn-8k&8rGnGpZ|42g@cd$ae0vA|ZHD;NL&*7u z&3^T^;4maPVPm{R+EG!lQFyaXZS8=GtsMC{A-x_ZE*`Z6_kK#OuX|Ws8`)R$bpz(m zjL&j1ET{wkVGAqtiL;^EizChH2h0(I=hc$;WhXPn(2_+>M09ifaS}n2|A9hAbfsE% z>5zj>-)X1SwH&g}g}1!q$ECy?4|P!5|KDZb)IC34t>I-F`HeR`KiIfAzZU69ug{pH zB^3wun95>rj*Lebx!jp3H1beqW401h zWg{5fYcy7!2My!7<*|<+2pt=InHOO+qg-Gz!sBJkH$*-$t|x@&Nk>oz7N24BsteV6 zeZN$uvgI%r=jVfi@!&+$c@z*jiWh20Hc|by@PgB4Jn?l?F6_gAZ(U;v7Q^l*e)wu2 zCmr$1fb+XN(|Ri>I)@R3R^mQ^9gxlF@Wlvuv}+IWPj9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jasD7 zFBEi#x`fF&l~>>1Y9EG5F16zQtFB}^7(OUgvcg<9fj4fSNLxZ8lV4tr-HTa<{spYe LZPDc?&)@hPj+<*0 diff --git a/code/GUI/gui.gd b/code/GUI/gui.gd index 551fc3c..68cb39f 100644 --- a/code/GUI/gui.gd +++ b/code/GUI/gui.gd @@ -1,6 +1,4 @@ extends Control - -# Called when the node enters the scene tree for the first time. func _ready() -> void: show() diff --git a/code/GUI/restartschild.gd b/code/GUI/restartschild.gd index dd25a18..5ed3392 100644 --- a/code/GUI/restartschild.gd +++ b/code/GUI/restartschild.gd @@ -3,7 +3,7 @@ extends TextureRect # Called when the node enters the scene tree for the first time. func _ready() -> void: - #global_position.y = -80 + $AnimationPlayer.play_backwards("out-in") hide() func _process(_delta: float) -> void: @@ -15,7 +15,10 @@ func _on_duck_gameover() -> void: $"../../Audio/GameOver".play() $"../../Audio/Gui-in".play() show() - + print($"/root/Global".hiscore) + if %ScoreContainer.get_score() > $"/root/Global".hiscore: + $"/root/Global".write_save() + func _on_restart_pressed() -> void: diff --git a/code/global.gd b/code/global.gd index 550ce79..bd5058e 100644 --- a/code/global.gd +++ b/code/global.gd @@ -4,36 +4,43 @@ extends Node signal levelup signal start + var maxspeed = 260 var speed = 100 var score = 0 var gamerunning = false + var hiscore func _ready() -> void: load_save() #write_save() - func load_save(): var data : FileAccess - if (not FileAccess.file_exists("user://save.json")) or FileAccess.open("user://save.json",FileAccess.READ_WRITE).get_as_text() == "": - data = FileAccess.open("user://save.json",FileAccess.WRITE) - data.store_string(FileAccess.open("res://code/first_save.json",FileAccess.READ).get_as_text()) + if (not FileAccess.file_exists("user://save.json")) or (FileAccess.open("user://save.json", FileAccess.READ_WRITE).get_as_text() == ""): + data = FileAccess.open("user://save.json", FileAccess.WRITE) + data.store_string(FileAccess.open("res://code/first_save.json", FileAccess.READ).get_as_text()) data.close() - data = FileAccess.open("user://save.json",FileAccess.READ) - var contenttext = JSON.parse_string(data.get_as_text()) - print(contenttext) - hiscore = contenttext["hiscore"] + data = FileAccess.open("user://save.json", FileAccess.READ) + var content_text = JSON.parse_string(data.get_as_text()) + + if content_text: + print("loaded: ",content_text) + hiscore = content_text.get("hiscore", 0) + else: + print("Failed to parse JSON") + data.close() + func write_save(): var data : FileAccess data = FileAccess.open("user://save.json",FileAccess.WRITE) - data.store_string( - JSON.stringify( + var content = JSON.stringify( { - "hiscore":$"/root/Game/Gui/HiscoreContainer/hiscore".get_score() + "hiscore":$/root/Game/Gui/ScoreContainer.get_score() } ) - ) + print("saved: ",content) + data.store_string(content) diff --git a/code/hiscore.gd b/code/hiscore.gd index 1705e36..0530526 100644 --- a/code/hiscore.gd +++ b/code/hiscore.gd @@ -8,11 +8,6 @@ func _ready() -> void: # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: pass - -func set_new_hiscore(): - if int(text) < int(%ScoreContainer/text.text): - text = %ScoreContainer/text.text - $"/root/Global".write_save() -func get_score(): - return int(text) +#func get_score(): +# return int(text) diff --git a/code/main.gd b/code/main.gd index e6bb6cb..05d5f17 100644 --- a/code/main.gd +++ b/code/main.gd @@ -1,8 +1,5 @@ extends Node -var biom_n = preload("res://assets/Ground/normal.png") -var biom_n_w = preload("res://assets/Ground/normal_wueste.png") -var biom_w = preload("res://assets/Ground/wueste.png") func _ready() -> void: $Screen/Background/Floor/EasterEggFixCollision.disabled = false $Gui/HiscoreContainer.show() @@ -10,11 +7,11 @@ func _ready() -> void: func start_game(): $Screen/Background/Floor/EasterEggFixCollision.disabled = true + $Screen/HindernissSpawner.del_all() + $Gui/EastereggSpawner.del_all() $Screen/SpawnTimer.start() $Screen/LevelUpTimer.start() $Screen/Duck.start() - $Screen/HindernissSpawner.del_all() - $Screen/EastereggSpawner.del_all() $Gui/HiscoreContainer.hide() %ScoreContainer.show() $"/root/Global".gamerunning = true @@ -35,12 +32,5 @@ func _score() -> void: %ScoreContainer/score.text = str($"/root/Global".score) func _process(delta): - var background_size_x = $Screen/Background/Sprite.texture.get_size().x - - var bla = (background_size_x) + $Screen/Background/Sprite.position.x - if $"/root/Global".gamerunning: - $Screen/Background/Sprite.position.x -= $"/root/Global".speed*delta - if bla <= 0: - #$Screen/Background/Sprite.texture =biom_n_w - $Screen/Background/Sprite.position.x = 0 + pass diff --git a/code/score.gd b/code/score.gd new file mode 100644 index 0000000..e4d6aea --- /dev/null +++ b/code/score.gd @@ -0,0 +1,14 @@ +extends HBoxContainer + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + +func get_score(): + return int($score.text) diff --git a/scenes/Duck/Duck.gd b/scenes/Duck/Duck.gd index 2258678..eff2a1b 100644 --- a/scenes/Duck/Duck.gd +++ b/scenes/Duck/Duck.gd @@ -14,6 +14,7 @@ func die(): func start(): global_position = Vector2(21,91) + velocity = Vector2(0,0) alive = true func _physics_process(delta: float) -> void: @@ -25,7 +26,7 @@ func _physics_process(delta: float) -> void: move_and_slide() func _process(_delta: float) -> void: - if position.x < -20: + if position.x < 20 or position.y > 100: if alive: die() @@ -43,8 +44,9 @@ func _process(_delta: float) -> void: $AnimationPlayer.play("walk") func _collide_with_hindernis(_body: Node2D) -> void: - if alive: - die() + pass + #if alive: + # die() func _color_slider_changed(value) -> void: diff --git a/scenes/Main.tscn b/scenes/Main.tscn index bc71e7a..eba4ea7 100644 --- a/scenes/Main.tscn +++ b/scenes/Main.tscn @@ -1,10 +1,11 @@ -[gd_scene load_steps=35 format=3 uid="uid://bb5qp5868y5i"] +[gd_scene load_steps=37 format=3 uid="uid://bb5qp5868y5i"] [ext_resource type="Script" path="res://code/main.gd" id="1_ar2ah"] [ext_resource type="PackedScene" uid="uid://8v5mbbnddorh" path="res://scenes/Duck/Duck.tscn" id="2"] [ext_resource type="Texture2D" uid="uid://dgfvf2ta4lc4e" path="res://assets/Ground/stars.png" id="2_ohf2r"] -[ext_resource type="Texture2D" uid="uid://bg78j6xxw3ck4" path="res://assets/Ground/normal.png" id="3"] +[ext_resource type="Script" path="res://scenes/ground/spawner/ground_spawner.gd" id="3_va7mo"] [ext_resource type="Script" path="res://scenes/hindernis/Spawner/hindernis_spawner.gd" id="4_oc6me"] +[ext_resource type="PackedScene" uid="uid://cjq8kb0mhjh8r" path="res://scenes/ground/ground.tscn" id="4_tt0te"] [ext_resource type="PackedScene" uid="uid://dm307sj4nenjt" path="res://scenes/schild.tscn" id="5_ewtcf"] [ext_resource type="Texture2D" uid="uid://do0okfxenx2ci" path="res://assets/GUI/restart button.png" id="6_boo0r"] [ext_resource type="Script" path="res://scenes/easteregg/Spawner/easteregg_spawner.gd" id="8_awkaj"] @@ -24,6 +25,7 @@ [ext_resource type="AudioStream" uid="uid://bktthpfrs0118" path="res://assets/audio/gui-out.ogg" id="21_frskh"] [ext_resource type="FontFile" uid="uid://ddvhypxkj8a1b" path="res://Megamichisfont-small.otf" id="21_uy1pc"] [ext_resource type="AudioStream" uid="uid://c4wrtvywao1jn" path="res://assets/audio/duckrun.wav" id="22_ijpe0"] +[ext_resource type="Script" path="res://code/score.gd" id="22_m4aei"] [sub_resource type="Animation" id="Animation_n8ktn"] length = 0.001 @@ -153,7 +155,6 @@ func _process(delta: float) -> void: func _change_time() -> void: - print(day) if day: $\"../AnimationPlayer\".play(\"change_time\") day = not day @@ -164,10 +165,10 @@ func _change_time() -> void: " [sub_resource type="RectangleShape2D" id="RectangleShape2D_o05as"] -size = Vector2(4, 15) +size = Vector2(2, 9.75) [sub_resource type="RectangleShape2D" id="RectangleShape2D_0a3yj"] -size = Vector2(361, 8) +size = Vector2(356.5, 8) [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jin1w"] @@ -209,7 +210,7 @@ autostart = true script = SubResource("GDScript_rkc4w") [node name="BackgroundRect" type="ColorRect" parent="Screen"] -offset_right = 1138.0 +offset_right = 1264.0 offset_bottom = 97.0 color = Color(0.560784, 0.937255, 0.937255, 1) @@ -220,33 +221,34 @@ modulate = Color(1, 1, 1, 0) position = Vector2(130, 50) texture = ExtResource("2_ohf2r") -[node name="Sprite" type="TextureRect" parent="Screen/Background"] -offset_top = 8.0 -offset_right = 1134.0 -offset_bottom = 300.0 -texture = ExtResource("3") -stretch_mode = 1 +[node name="GroundSpawner" type="Node2D" parent="Screen/Background"] +position = Vector2(0, 8) +script = ExtResource("3_va7mo") + +[node name="Ground" parent="Screen/Background/GroundSpawner" instance=ExtResource("4_tt0te")] [node name="Floor" type="StaticBody2D" parent="Screen/Background"] [node name="EasterEggFixCollision" type="CollisionShape2D" parent="Screen/Background/Floor"] -position = Vector2(-2, 83) +visible = false +position = Vector2(14, 86.875) shape = SubResource("RectangleShape2D_o05as") [node name="CollisionShape2D" type="CollisionShape2D" parent="Screen/Background/Floor"] -position = Vector2(176, 96) +position = Vector2(178.25, 96) shape = SubResource("RectangleShape2D_0a3yj") -[node name="HindernissSpawner" type="Marker2D" parent="Screen"] -position = Vector2(446, 92) -script = ExtResource("4_oc6me") - [node name="Duck" parent="Screen" instance=ExtResource("2")] position = Vector2(21, 91) +[node name="HindernissSpawner" type="Marker2D" parent="Screen"] +position = Vector2(485, 92) +script = ExtResource("4_oc6me") + [node name="WolkenSpawner" type="Marker2D" parent="Screen"] -position = Vector2(485, -1) +position = Vector2(485, 0) script = ExtResource("11_x2wm3") +metadata/_edit_lock_ = true [node name="LevelUpTimer" type="Timer" parent="Screen"] wait_time = 5.0 @@ -257,10 +259,6 @@ wait_time = 1.6 [node name="WolkenTimer" type="Timer" parent="Screen"] autostart = true -[node name="EastereggSpawner" type="Marker2D" parent="Screen"] -position = Vector2(81, -18) -script = ExtResource("8_awkaj") - [node name="Gui" type="Control" parent="."] layout_mode = 3 anchors_preset = 15 @@ -269,9 +267,13 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("8_t3tw7") +metadata/_edit_lock_ = true + +[node name="EastereggSpawner" type="Marker2D" parent="Gui"] +position = Vector2(81, -18) +script = ExtResource("8_awkaj") [node name="HiscoreContainer" type="VBoxContainer" parent="Gui"] -visible = false layout_mode = 1 offset_left = 1.0 offset_top = 1.0 @@ -283,7 +285,7 @@ theme_override_constants/separation = 0 layout_mode = 2 theme_override_fonts/font = ExtResource("21_uy1pc") theme_override_font_sizes/font_size = 8 -text = "Your Hiscore:" +text = "Your Highscore:" [node name="hiscore" type="Label" parent="Gui/HiscoreContainer"] layout_mode = 2 @@ -292,34 +294,6 @@ theme_override_font_sizes/font_size = 8 text = "0" script = ExtResource("21_5nnhv") -[node name="ScoreContainer" type="HBoxContainer" parent="Gui"] -unique_name_in_owner = true -layout_mode = 1 -anchors_preset = 5 -anchor_left = 0.5 -anchor_right = 0.5 -offset_left = -28.0 -offset_top = 17.0 -offset_right = 29.0 -offset_bottom = 24.0 -grow_horizontal = 2 - -[node name="text" type="Label" parent="Gui/ScoreContainer"] -layout_mode = 2 -theme_override_fonts/font = ExtResource("21_uy1pc") -theme_override_font_sizes/font_size = 8 -text = "Score:" - -[node name="score" type="Label" parent="Gui/ScoreContainer"] -layout_mode = 2 -theme_override_fonts/font = ExtResource("21_uy1pc") -theme_override_font_sizes/font_size = 8 -text = " " - -[node name="ScoreCounter" type="Timer" parent="Gui/ScoreContainer/score"] -wait_time = 0.1 -autostart = true - [node name="Settings" parent="Gui" instance=ExtResource("5_ewtcf")] visible = false layout_mode = 1 @@ -515,6 +489,35 @@ size_flags_horizontal = 4 size_flags_vertical = 4 texture_normal = ExtResource("14_4hepj") +[node name="ScoreContainer" type="HBoxContainer" parent="Gui"] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -28.0 +offset_top = 17.0 +offset_right = 29.0 +offset_bottom = 24.0 +grow_horizontal = 2 +script = ExtResource("22_m4aei") + +[node name="text" type="Label" parent="Gui/ScoreContainer"] +layout_mode = 2 +theme_override_fonts/font = ExtResource("21_uy1pc") +theme_override_font_sizes/font_size = 8 +text = "Score:" + +[node name="score" type="Label" parent="Gui/ScoreContainer"] +layout_mode = 2 +theme_override_fonts/font = ExtResource("21_uy1pc") +theme_override_font_sizes/font_size = 8 +text = " " + +[node name="ScoreCounter" type="Timer" parent="Gui/ScoreContainer/score"] +wait_time = 0.1 +autostart = true + [node name="Audio" type="Node" parent="."] [node name="Gui-in" type="AudioStreamPlayer" parent="Audio"] @@ -535,12 +538,12 @@ autoplay = true bus = &"Background" [connection signal="timeout" from="Screen/Day-NightTimer" to="Screen/Day-NightTimer" method="_change_time"] +[connection signal="screen_entered" from="Screen/Background/GroundSpawner/Ground" to="Screen/Background/GroundSpawner" method="_on_ground_sprite_screen_entered"] [connection signal="gameover" from="Screen/Duck" to="Gui/HiscoreContainer/hiscore" method="set_new_hiscore"] [connection signal="gameover" from="Screen/Duck" to="Gui/GameOverSchild" method="_on_duck_gameover"] [connection signal="timeout" from="Screen/LevelUpTimer" to="." method="_on_level_up_timer_timeout"] [connection signal="timeout" from="Screen/SpawnTimer" to="Screen/HindernissSpawner" method="_spawn"] [connection signal="timeout" from="Screen/WolkenTimer" to="Screen/WolkenSpawner" method="_spawn"] -[connection signal="timeout" from="Gui/ScoreContainer/score/ScoreCounter" to="." method="_score"] [connection signal="pressed" from="Gui/Settings/BackButton" to="Gui/Settings" method="_on_back_pressed"] [connection signal="value_changed" from="Gui/Settings/ColorSlider" to="Screen/Duck" method="_color_slider_changed"] [connection signal="value_changed" from="Gui/Settings/VolumeSlider" to="Gui/Settings" method="_volume_slider_changed"] @@ -548,4 +551,5 @@ bus = &"Background" [connection signal="pressed" from="Gui/GameOverSchild/Restart" to="Gui/GameOverSchild" method="_on_restart_pressed"] [connection signal="pressed" from="Gui/StartSchild/Start" to="Gui/StartSchild" method="_on_start_pressed"] [connection signal="pressed" from="Gui/StartSchild/Settings" to="Gui/StartSchild" method="_on_settings_pressed"] -[connection signal="pressed" from="Gui/StartSchild/Logo" to="Screen/EastereggSpawner" method="_spawn"] +[connection signal="pressed" from="Gui/StartSchild/Logo" to="Gui/EastereggSpawner" method="_spawn"] +[connection signal="timeout" from="Gui/ScoreContainer/score/ScoreCounter" to="." method="_score"] diff --git a/scenes/Wolke/wolke.gd b/scenes/Wolke/wolke.gd index 3290bfd..f746c22 100644 --- a/scenes/Wolke/wolke.gd +++ b/scenes/Wolke/wolke.gd @@ -9,5 +9,6 @@ func _ready() -> void: frame = randi_range(0,4) self_modulate = Color(1,1,1,randf_range(0,0.5)) + func _process(delta: float) -> void: global_position.x -= speed * delta diff --git a/scenes/ground/ground.gd b/scenes/ground/ground.gd new file mode 100644 index 0000000..b1522b5 --- /dev/null +++ b/scenes/ground/ground.gd @@ -0,0 +1,19 @@ +extends Sprite2D + +signal screen_entered + +var speed: float + +func _ready() -> void: + pass + +func _physics_process(delta: float) -> void: + if $"/root/Global".gamerunning: + global_position.x -= $"/root/Global".speed*delta + + +func screen_e() -> void: + screen_entered.emit() + +func screen_exited() -> void: + queue_free() diff --git a/scenes/ground/ground.tscn b/scenes/ground/ground.tscn new file mode 100644 index 0000000..c253040 --- /dev/null +++ b/scenes/ground/ground.tscn @@ -0,0 +1,17 @@ +[gd_scene load_steps=3 format=3 uid="uid://cjq8kb0mhjh8r"] + +[ext_resource type="Texture2D" uid="uid://bg78j6xxw3ck4" path="res://assets/Ground/n.png" id="1_ocn3x"] +[ext_resource type="Script" path="res://scenes/ground/ground.gd" id="2_eg3te"] + +[node name="Ground" type="Sprite2D"] +texture_filter = 1 +texture = ExtResource("1_ocn3x") +centered = false +script = ExtResource("2_eg3te") + +[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."] +position = Vector2(399.5, 82.5) +scale = Vector2(0.05, -0.05) + +[connection signal="screen_entered" from="VisibleOnScreenNotifier2D" to="." method="screen_e"] +[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="screen_exited"] diff --git a/scenes/ground/spawner/ground_spawner.gd b/scenes/ground/spawner/ground_spawner.gd new file mode 100644 index 0000000..33f4d3d --- /dev/null +++ b/scenes/ground/spawner/ground_spawner.gd @@ -0,0 +1,51 @@ +extends Node2D + +var texture_new_sprite : Texture + +var biom_n = preload("res://assets/Ground/n.png") +var biom_n_w = preload("res://assets/Ground/n_w.png") +var biom_w_n = preload("res://assets/Ground/w_n.png") +var biom_w = preload("res://assets/Ground/w.png") + +var active_biom = "n" +var passed + + +func probability(prozent): + return randf() > 1-(0.01*20) # 20% warscheinlichkeit um biom zu tauschen + +func handle_biom_change(): + if active_biom == "n": + if probability(20): + active_biom = "n_w" + elif active_biom == "n_w": + active_biom = "w" + elif active_biom == "w": + active_biom = "w_n" + elif active_biom == "w_n": + active_biom = "n" + set_biom_texture() + +func set_biom_texture(): + #print("activebiom_s: " + active_biom) + if active_biom == "w": + texture_new_sprite = biom_w + elif active_biom == "n": + texture_new_sprite = biom_n + elif active_biom == "w_n": + texture_new_sprite = biom_w_n + elif active_biom == "n_w": + texture_new_sprite = biom_n_w + + +func _spawn(last_x_position) -> void: + var new_ground = preload("res://scenes/ground/ground.tscn").instantiate() + new_ground.texture = texture_new_sprite + new_ground.global_position.x = last_x_position+400 + add_child(new_ground) + new_ground.connect("screen_entered",_on_ground_sprite_screen_entered) + + +func _on_ground_sprite_screen_entered() -> void: + handle_biom_change() + _spawn(get_child(0).position.x) diff --git a/scenes/hindernis/Spawner/hindernis_spawner.gd b/scenes/hindernis/Spawner/hindernis_spawner.gd index 2fb7ad3..14e251f 100644 --- a/scenes/hindernis/Spawner/hindernis_spawner.gd +++ b/scenes/hindernis/Spawner/hindernis_spawner.gd @@ -13,10 +13,10 @@ func _spawn() -> void: var v1 = 1.5 - (speed / 260) var v2 = 2.0 - (speed / 260) - print(str(v1)," ",str(v2)) + #print(str(v1)," ",str(v2)) $"../SpawnTimer".wait_time = randf_range(v1,v2) - print("speed: ",speed) + #print("speed: ",speed) add_child(hindernis) func del_all(): diff --git a/scenes/hindernis/hindernis.gd b/scenes/hindernis/hindernis.gd index 90ff199..d52d5ee 100644 --- a/scenes/hindernis/hindernis.gd +++ b/scenes/hindernis/hindernis.gd @@ -9,3 +9,5 @@ func _ready() -> void: func _process(delta: float) -> void: speed = $"..".speed global_position.x -= speed*delta + if global_position.x < -30: + queue_free()