Skip to content

Commit

Permalink
continue work on catching
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatNateDev committed Aug 3, 2024
1 parent ebc7891 commit 2ddd8a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion scripts/item_animations.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ extends Control
@onready var res = get_parent().get_node("Move_layer/item")
@onready var player = get_parent().get_node("Cast/Player/Player_sprite")
@onready var enemy = get_parent().get_node("Cast/Enemy/Enemy_sprite")
func Item_anim(item):
@onready var pkmn = pokemon.new()
func Item_anim(item, e):
match item:
"poke_ball":
res.position = player.global_position
Expand All @@ -29,5 +30,6 @@ func Item_anim(item):
await get_tree().create_timer(1).timeout
res.skew = 50
await get_tree().create_timer(1).timeout
var catch1 = (3 * e.max_hp - 2 * e.hp) *
res.hide()
res.scale = Vector2(1,1)
2 changes: 2 additions & 0 deletions scripts/main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func random_enemy_level_one():
"current": null,
"sprite" : get_random_mon(1),
"type": set_enemy_type(),
"max_hp": data.Enemy.hp,
"pokemon": null
}
refine_level_stats(data.Enemy,false,true)
func reset_bars():
Expand Down
5 changes: 3 additions & 2 deletions scripts/pokemon.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extends Control
class_name pokemon
signal pkmn_data(pkmn)
@export var zigzagoon = {
"type": "Normal"
Expand All @@ -19,6 +20,6 @@ signal pkmn_data(pkmn)
"torchic": torchic,
}

func _on_main_window_type_requester(pokemon):
var data = pkmn.get(pokemon)
func _on_main_window_type_requester(pokemoner):
var data = pkmn.get(pokemoner)
pkmn_data.emit(data.type)

0 comments on commit 2ddd8a5

Please sign in to comment.