Skip to content

Commit

Permalink
Final
Browse files Browse the repository at this point in the history
  • Loading branch information
geofany committed Nov 28, 2019
1 parent b95b20c commit 9e1ab8e
Show file tree
Hide file tree
Showing 34 changed files with 5,363 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="e28647d0ea756aae55711292a0dbbbbd"
dest_md5="3bf5c0d1c8c22688778d3f494a13b11a"

Binary file not shown.
3 changes: 3 additions & 0 deletions .import/Timer.png-93c6a7a43d328ffa2f2865c14898c881.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source_md5="ab2f556f65bec76af9a1a0db1cd7c431"
dest_md5="0bbbdb746da9fc61dbd15d070b3bf69f"

Binary file not shown.
Binary file added Assets/Sounds/Chicken Sound.mp3
Binary file not shown.
Binary file added Assets/Sounds/Chicken Sound.ogg
Binary file not shown.
15 changes: 15 additions & 0 deletions Assets/Sounds/Chicken Sound.ogg.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[remap]

importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/Chicken Sound.ogg-cc6e4bae87796593a26eff8163a9367d.oggstr"

[deps]

source_file="res://Assets/Sounds/Chicken Sound.ogg"
dest_files=[ "res://.import/Chicken Sound.ogg-cc6e4bae87796593a26eff8163a9367d.oggstr" ]

[params]

loop=true
loop_offset=0
Binary file added Assets/Timer.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/Timer.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

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

[deps]

source_file="res://Assets/Timer.png"
dest_files=[ "res://.import/Timer.png-93c6a7a43d328ffa2f2865c14898c881.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=true
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
4 changes: 3 additions & 1 deletion GameOver.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ func _ready():

func _on_Play_pressed():
get_tree().paused = false
get_tree().change_scene("Level 1.tscn")
var lvl = GlobalVar.currentLevel
var repeat = "Level %d.tscn" % lvl
get_tree().change_scene(repeat)

func _on_Exit_pressed():
get_tree().paused = false
Expand Down
2 changes: 2 additions & 0 deletions GlobalVar.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ var level4 = false
var level5 = false
var level6 = false

var currentLevel

var makanan = false
var minuman = false
var vaksin = false
Expand Down
10 changes: 9 additions & 1 deletion Level 1.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ func _ready():
GlobalVar.makan = 1
GlobalVar.minum = 1
GlobalVar.vaks = 1

GlobalVar.targetLevel = 1
GlobalVar.currentLevel = 1
$Win.hide()
$Tutorial.show()
$GameOver.hide()
Expand All @@ -24,6 +25,13 @@ func _process(delta):
GlobalVar.time -= delta
if GlobalVar.time <= 1:
get_tree().paused = true
GlobalVar.currentLevel = 1
GlobalVar.targetLevel += 1
GlobalVar.makanan = false
GlobalVar.minuman = false
GlobalVar.vaksin = false
Input.set_custom_mouse_cursor(null)
GlobalVar.level2 = true
$Win.show()

GlobalVar.hidup = get_tree().get_nodes_in_group("chickens").size() - GlobalVar.mati
Expand Down
43 changes: 25 additions & 18 deletions Level 1.tscn
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[gd_scene load_steps=248 format=2]
[gd_scene load_steps=249 format=2]

[ext_resource path="res://Level 1.gd" type="Script" id=1]
[ext_resource path="res://Assets/Background_hujan.png" type="Texture" id=2]
[ext_resource path="res://Assets/Background_vf.png" type="Texture" id=3]
[ext_resource path="res://Assets/Kayu AS.png" type="Texture" id=4]
[ext_resource path="res://ayam1.gd" type="Script" id=5]
[ext_resource path="res://Assets/Ayam Senang Idle.png" type="Texture" id=6]
[ext_resource path="res://Assets/Ayam Senang Gerak.png" type="Texture" id=7]
[ext_resource path="res://Assets/Ayam Mati.png" type="Texture" id=8]
[ext_resource path="res://Assets/Ayam Marah Idle.png" type="Texture" id=9]
[ext_resource path="res://Assets/Ayam Marah Gerak.png" type="Texture" id=10]
[ext_resource path="res://Assets/Ayam Normal Idle.png" type="Texture" id=11]
[ext_resource path="res://Assets/Ayam Normal Gerak.png" type="Texture" id=12]
[ext_resource path="res://Assets/Ayam Marah Idle.png" type="Texture" id=6]
[ext_resource path="res://Assets/Ayam Marah Gerak.png" type="Texture" id=7]
[ext_resource path="res://Assets/Ayam Normal Idle.png" type="Texture" id=8]
[ext_resource path="res://Assets/Ayam Normal Gerak.png" type="Texture" id=9]
[ext_resource path="res://Assets/Ayam Mati.png" type="Texture" id=10]
[ext_resource path="res://Assets/Ayam Senang Idle.png" type="Texture" id=11]
[ext_resource path="res://Assets/Ayam Senang Gerak.png" type="Texture" id=12]
[ext_resource path="res://Assets/Ayam Sakit.png" type="Texture" id=13]
[ext_resource path="res://Assets/belakang.png" type="Texture" id=14]
[ext_resource path="res://Assets/atas.png" type="Texture" id=15]
Expand Down Expand Up @@ -233,6 +233,7 @@
[ext_resource path="res://HUD.tscn" type="PackedScene" id=231]
[ext_resource path="res://GameOver.tscn" type="PackedScene" id=232]
[ext_resource path="res://Win.tscn" type="PackedScene" id=233]
[ext_resource path="res://Assets/Sounds/Chicken Sound.ogg" type="AudioStream" id=234]

[sub_resource type="SpriteFrames" id=1]
animations = [ {
Expand Down Expand Up @@ -277,22 +278,22 @@ bg_color = Color( 0.6, 0.6, 0.6, 0 )
animations = [ {
"frames": [ ExtResource( 6 ), ExtResource( 6 ), ExtResource( 6 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 6 ), ExtResource( 7 ) ],
"loop": true,
"name": "Senang",
"name": "Marah",
"speed": 3.0
}, {
"frames": [ ExtResource( 8 ) ],
"frames": [ ExtResource( 8 ), ExtResource( 8 ), ExtResource( 8 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 8 ), ExtResource( 9 ) ],
"loop": true,
"name": "Mati",
"speed": 1.0
"name": "Normal",
"speed": 3.0
}, {
"frames": [ ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 9 ), ExtResource( 10 ) ],
"frames": [ ExtResource( 10 ) ],
"loop": true,
"name": "Marah",
"speed": 3.0
"name": "Mati",
"speed": 1.0
}, {
"frames": [ ExtResource( 11 ), ExtResource( 11 ), ExtResource( 11 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 11 ), ExtResource( 12 ) ],
"loop": true,
"name": "Normal",
"name": "Senang",
"speed": 3.0
}, {
"frames": [ ExtResource( 13 ) ],
Expand Down Expand Up @@ -369,6 +370,7 @@ texture = ExtResource( 3 )
normal_map = SubResource( 2 )

[node name="ScrollContainer" type="ScrollContainer" parent="."]
editor/display_folded = true
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 1280.0
Expand Down Expand Up @@ -411,6 +413,7 @@ scale = Vector2( 0.79989, 0.79989 )
texture = ExtResource( 4 )

[node name="Baris 1" type="Node2D" parent="ScrollContainer/VBoxContainer"]
editor/display_folded = true
position = Vector2( 15, 0 )
__meta__ = {
"_edit_group_": true
Expand Down Expand Up @@ -641,16 +644,20 @@ visible = false

[node name="Win" parent="." instance=ExtResource( 233 )]
visible = false

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 234 )
autoplay = true
[connection signal="pressed" from="ScrollContainer/VBoxContainer/Baris 1/ayam1" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_ayam1_pressed"]
[connection signal="timeout" from="ScrollContainer/VBoxContainer/Baris 1/ayam1/HPTimer" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_HPTimer_timeout"]
[connection signal="timeout" from="ScrollContainer/VBoxContainer/Baris 1/ayam1/SakitTimer" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_SakitTimer_timeout"]
[connection signal="pressed" from="ScrollContainer/VBoxContainer/Baris 1/ayam2" to="ScrollContainer/VBoxContainer/Baris 1/ayam2" method="_on_ayam1_pressed"]
[connection signal="timeout" from="ScrollContainer/VBoxContainer/Baris 1/ayam2/HPTimer" to="ScrollContainer/VBoxContainer/Baris 1/ayam2" method="_on_HPTimer_timeout"]
[connection signal="timeout" from="ScrollContainer/VBoxContainer/Baris 1/ayam2/SakitTimer" to="ScrollContainer/VBoxContainer/Baris 1/ayam2" method="_on_SakitTimer_timeout"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/Bk1" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_Bk1_toggled"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/Bk1" to="ScrollContainer/VBoxContainer/Baris 1/ayam2" method="_on_Bk1_toggled"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/BL1" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_BL1_toggled"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/Bk1" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_Bk1_toggled"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/BL1" to="ScrollContainer/VBoxContainer/Baris 1/ayam2" method="_on_BL1_toggled"]
[connection signal="toggled" from="ScrollContainer/VBoxContainer/Baris 1/BL1" to="ScrollContainer/VBoxContainer/Baris 1/ayam1" method="_on_BL1_toggled"]
[connection signal="pressed" from="Tools/makanan" to="Tools" method="_on_makanan_pressed"]
[connection signal="pressed" from="Tools/Air" to="Tools" method="_on_air_pressed"]
[connection signal="pressed" from="Tools/vaksin" to="Tools" method="_on_vaksin_pressed"]
Expand Down
10 changes: 9 additions & 1 deletion Level 2.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ func _ready():
GlobalVar.makan = 2
GlobalVar.minum = 2
GlobalVar.vaks = 2

GlobalVar.targetLevel = 2
GlobalVar.currentLevel = 2
$Win.hide()
$GameOver.hide()
$PauseMenu.hide()
Expand All @@ -23,6 +24,13 @@ func _process(delta):
GlobalVar.time -= delta
if GlobalVar.time <= 1:
get_tree().paused = true
GlobalVar.currentLevel = 2
GlobalVar.targetLevel += 1
GlobalVar.makanan = false
GlobalVar.minuman = false
GlobalVar.vaksin = false
Input.set_custom_mouse_cursor(null)
GlobalVar.level3 = true
$Win.show()

GlobalVar.hidup = get_tree().get_nodes_in_group("chickens").size() - GlobalVar.mati
Expand Down
90 changes: 90 additions & 0 deletions Level 3.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
extends Control

var cuaca

func _ready():
GlobalVar.makan = 3
GlobalVar.minum = 3
GlobalVar.vaks = 3
GlobalVar.targetLevel = 3
GlobalVar.currentLevel = 3
$Win.hide()
$GameOver.hide()
$PauseMenu.hide()
$ScrollContainer.get_h_scrollbar().hide()

GlobalVar.hidup = 0
GlobalVar.mati = 0
if GlobalVar.targetLevel != 1:
get_tree().paused = false
GlobalVar.time = 60.0
cuaca = "panas"

func _process(delta):
GlobalVar.time -= delta
if GlobalVar.time <= 1:
get_tree().paused = true
GlobalVar.currentLevel = 3
GlobalVar.targetLevel += 1
GlobalVar.makanan = false
GlobalVar.minuman = false
GlobalVar.vaksin = false
Input.set_custom_mouse_cursor(null)
GlobalVar.level4 = true
$Win.show()

GlobalVar.hidup = get_tree().get_nodes_in_group("chickens").size() - GlobalVar.mati
if GlobalVar.hidup <= get_tree().get_nodes_in_group("chickens").size()/2:
get_tree().paused = true
print("Game Over")
$GameOver.show()

if get_tree().paused:
$HUD.hide()
else:
$HUD.show()


func randomly(inputan):
return inputan[randi() % inputan.size()]

func _on_CuacaTimer_timeout():
randomize()
var x = randomly([0,1])
if x == 0:
GlobalVar.cuaca = "Panas"
else:
GlobalVar.cuaca = "Hujan"
get_node("/root/Level 3/Background").play(GlobalVar.cuaca)
var t = rand_range(0,100)
get_node("/root/Level 3/CuacaTimer").start(t)

func _on_SakitTimer_ready():
pass # Replace with function body.

func _on_MakananTimer_timeout():
GlobalVar.makan = 3
get_node("/root/Level 3/Tools/makanan/makan").play("idle")
pass # Replace with function body.

func _on_MinumanTimer_timeout():
GlobalVar.minum = 3
get_node("/root/Level 3/Tools/Air/air").play("idle")
pass # Replace with function body.

func _on_VaksinTimer_timeout():
GlobalVar.vaks = 3
get_node("/root/Level 3/Tools/vaksin/Vaksin").play("idle")
pass # Replace with function body.

func _on_PauseButton_pressed():
$PauseMenu.show()
get_tree().paused = true

func _on_Continue_pressed():
$PauseMenu.hide()
get_tree().paused = false

func _on_Exit_pressed():
get_tree().paused = false
get_tree().change_scene("MainMenu.tscn")
Loading

0 comments on commit 9e1ab8e

Please sign in to comment.