Skip to content

Commit

Permalink
balas funcionales, ya comunican el impacto, npc en escenario con posi…
Browse files Browse the repository at this point in the history
…bilidad de recibir daño, ese daño no tiene comportamiento
  • Loading branch information
SergioJimenezM committed Sep 8, 2019
1 parent 0b2ffb4 commit a8b1d76
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 5 deletions.
8 changes: 4 additions & 4 deletions proyectoTanks/escenas/Mapa.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
[ext_resource path="res://icon.png" type="Texture" id=2]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 380, 10 )
extents = Vector2( 370, 10 )

[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 380, 10 )
extents = Vector2( 370, 10 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 10, 300 )
Expand All @@ -33,7 +33,7 @@ __meta__ = {
}

[node name="colisionSuperior" type="CollisionShape2D" parent="."]
position = Vector2( 390, 8 )
position = Vector2( 400, 8 )
shape = SubResource( 1 )
__meta__ = {
"_edit_lock_": true
Expand Down Expand Up @@ -61,7 +61,7 @@ __meta__ = {
}

[node name="puntoDeSpawn2" type="Position2D" parent="."]
position = Vector2( 80, 300 )
position = Vector2( 100, 300 )
__meta__ = {
"_edit_lock_": true
}
1 change: 0 additions & 1 deletion proyectoTanks/escenas/kbNPCprovicional.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[ext_resource path="res://scripts/kbNPCprovicional.gd" type="Script" id=1]
[ext_resource path="res://sprites/tankeEstructuraVerde.png" type="Texture" id=2]


[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 68.804, 82.5844 )

Expand Down
28 changes: 28 additions & 0 deletions proyectoTanks/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,34 @@ ui_cancel={
"events": [ Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
}
ui_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
}
ui_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
]
}
ui_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
]
}
ui_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
]
}
ui_shoot={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777237,"unicode":0,"echo":false,"script":null)
Expand Down
5 changes: 5 additions & 0 deletions proyectoTanks/scripts/Mapa.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ extends Node2D

func _ready():
var spawn = get_node("puntoDeSpawn1")
var spawn2 = get_node("puntoDeSpawn2")
var tank = load("res://escenas/tankeJugador.tscn").instance()
var npc = load("res://escenas/kbNPCprovicional.tscn").instance()
tank.set_position(spawn.get_position())
npc.set_position(spawn2.get_position())
get_parent().add_child(tank)
get_parent().add_child(npc)

2 changes: 2 additions & 0 deletions proyectoTanks/scripts/bala.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ func inicio(pos, dir):
func _physics_process(delta):
var collision = move_and_collide(velocity*delta)
if collision:
if collision.collider.has_method("recibeDamages"):
collision.collider.recibeDamages()
queue_free()
pass
4 changes: 4 additions & 0 deletions proyectoTanks/scripts/kbNPCprovicional.gd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ func atacar():

pass

func recibeDamages():
print("DAÑOOOOO")
pass

func _physics_process(delta):

pass

0 comments on commit a8b1d76

Please sign in to comment.