Skip to content

Commit

Permalink
getting close
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatNateDev committed Aug 3, 2024
1 parent da4b2f2 commit ebc7891
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion scripts/item_animations.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ func Item_anim(item):
var tweene = get_tree().create_tween()
tweene.tween_property(res,"rotation",360,1)
await get_tree().create_timer(1).timeout
var x = enemy.get_rect().size.x
x = x / 2
var y = enemy.get_rect().size.y
y = y / 2
res.hide()
enemy.hide()
await get_tree().create_timer(.2).timeout
res.position = res.position - Vector2(x,y)
res.rotation = 0
res.show()
var tweenw = get_tree().create_tween()
tweenw.tween_property(res,"position",res.position.y + 20,1)
tweenw.tween_property(res,"position",Vector2(res.position.x,res.position.y + 100),1)
await get_tree().create_timer(1).timeout
res.skew = 50
await get_tree().create_timer(1).timeout
res.hide()
res.scale = Vector2(1,1)
4 changes: 2 additions & 2 deletions scripts/items.gd
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
extends Control
signal animation(item)
func _on_main_window_run_items(item):
func _on_main_window_run_items(item,enemy):
match item:
"potion":
#run pokemon menu
#click pokemon
#handle heals
pass
"poke_ball":
animation.emit(item)
animation.emit(item,enemy)
#catch_rate
#handle fail and catch
pass
2 changes: 1 addition & 1 deletion scripts/main_window.gd
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func Item_pressed(key):
$Cast/darken.hide()
$Castless/Bag.hide()
disable_btns(false)
run_items.emit(key)
run_items.emit(key,data.Enemy)
func shop():
Globals.money = data.Money
get_tree().change_scene_to_file("res://scenes/shop.tscn")

0 comments on commit ebc7891

Please sign in to comment.