Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Heinen committed Apr 9, 2017
1 parent 856f813 commit 3147675
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 3 deletions.
Binary file added Sprites/Container/Crate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Sprites/Container/Crate.xcf
Binary file not shown.
Binary file added Sprites/Container/Drinkomat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Sprites/Container/Drinkomat.xcf
Binary file not shown.
Binary file added Sprites/Container/muelleimer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Sprites/Container/muelleimer.xcf
Binary file not shown.
4 changes: 2 additions & 2 deletions enemy/enemy.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ extents = Vector2( 9.9237, 9.89589 )

[sub_resource type="GDScript" id=2]

script/source = "#extends RigidBody2D\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar damage = 10\nvar health = 100\n\nvar enemy_size\n\nvar direction = Vector2(1.0, 0.0) #right\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tenemy_size = get_node(\"enemy\").get_texture().get_size()\n\t\n\t\n\tset_fixed_process(true)\n\nfunc _integrate_forces(s):\n\t\n\t#print(s.get_contact_count())\n\t\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar move_left = false\n\tvar move_right = false\n\tvar move_up = false\n\tvar move_down = false\n\t\n\t#var shoot = Input.is_action_pressed(\"shoot\")\n\n\tvar enemy_rect = Rect2( get_node(\"enemy\").get_pos() - enemy_size*0.5, enemy_size )\n\tvar enemy_pos = get_node(\"enemy\").get_pos()\n\t\n\t\n\tif (move_left and not move_right): #left\n\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\tlv.x -= WALK_ACCEL*step\n\t\tdirection = Vector2(-1.0, 0.0)\n\telif (move_right and not move_left): #right\n\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\tlv.x += WALK_ACCEL*step\n\t\tdirection = Vector2(1.0, 0.0)\n\telif (move_down and not move_up): #down\n\t\tif (lv.y < WALK_MAX_VELOCITY):\n\t\t\tlv.y += WALK_ACCEL*step\n\t\tdirection = Vector2(0.0, 1.0)\n\telif (move_up and not move_down): #ip\n\t\tif (lv.y > -WALK_MAX_VELOCITY):\n\t\t\tlv.y -= WALK_ACCEL*step\n\t\tdirection = Vector2(0.0, -1.0)\n\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\tvar yv = abs(lv.y)\n\t\t\t\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\t\n\t\t\tyv -= WALK_DEACCEL*step\n\t\t\tif (yv < 0):\n\t\t\t\tyv = 0\n\t\t\tlv.y = sign(lv.y)*yv\n\t\t\t\n\ts.set_linear_velocity(lv)\n\n\nfunc _on_enemy_body_enter( body ):\n\t#body.\n\tprint(\"enemy coll\")\n\tpass # replace with function body\n\nfunc getDamage():\n\treturn damage"
script/source = "#extends RigidBody2D\nvar WALK_ACCEL = 800.0\nvar WALK_DEACCEL = 800.0\nvar WALK_MAX_VELOCITY = 200.0\nvar damage = 10\nvar health = 100\n\nvar move_direction = Vector2(1,0)\n\nvar enemy_size\n\nvar direction = Vector2(1.0, 0.0) #right\n\nfunc _ready():\n\t# Called every time the node is added to the scene.\n\t# Initialization here\n\tenemy_size = get_node(\"enemy\").get_texture().get_size()\n\t\n\t\n\tset_fixed_process(true)\n\n\nfunc _integrate_forces(s):\n\t\n\tprint(randf())\n\t#print(s.get_contact_count())\n\t\n\tvar lv = s.get_linear_velocity()\n\tvar step = s.get_step()\n\t\n\tvar move_left = false\n\tvar move_right = false\n\tvar move_up = false\n\tvar move_down = false\n\t\n\t#var shoot = Input.is_action_pressed(\"shoot\")\n\n\tvar enemy_rect = Rect2( get_node(\"enemy\").get_pos() - enemy_size*0.5, enemy_size )\n\tvar enemy_pos = get_node(\"enemy\").get_pos()\n\t\n\t\n\tif (move_left and not move_right): #left\n\t\tif (lv.x > -WALK_MAX_VELOCITY):\n\t\t\tlv.x -= WALK_ACCEL*step\n\t\tdirection = Vector2(-1.0, 0.0)\n\telif (move_right and not move_left): #right\n\t\tif (lv.x < WALK_MAX_VELOCITY):\n\t\t\tlv.x += WALK_ACCEL*step\n\t\tdirection = Vector2(1.0, 0.0)\n\telif (move_down and not move_up): #down\n\t\tif (lv.y < WALK_MAX_VELOCITY):\n\t\t\tlv.y += WALK_ACCEL*step\n\t\tdirection = Vector2(0.0, 1.0)\n\telif (move_up and not move_down): #ip\n\t\tif (lv.y > -WALK_MAX_VELOCITY):\n\t\t\tlv.y -= WALK_ACCEL*step\n\t\tdirection = Vector2(0.0, -1.0)\n\telse:\n\t\t\tvar xv = abs(lv.x)\n\t\t\tvar yv = abs(lv.y)\n\t\t\t\n\t\t\txv -= WALK_DEACCEL*step\n\t\t\tif (xv < 0):\n\t\t\t\txv = 0\n\t\t\tlv.x = sign(lv.x)*xv\n\t\t\t\n\t\t\tyv -= WALK_DEACCEL*step\n\t\t\tif (yv < 0):\n\t\t\t\tyv = 0\n\t\t\tlv.y = sign(lv.y)*yv\n\t\t\t\n\ts.set_linear_velocity(lv)\n\n\nfunc _on_enemy_body_enter( body ):\n\t#body.\n\tprint(\"enemy coll\")\n\tpass # replace with function body\n\nfunc getDamage():\n\treturn damage"

[node name="enemy" type="RigidBody2D" groups=[ "enemy" ]]

Expand All @@ -21,7 +21,7 @@ shapes/0/transform = Matrix32( 2.83209, 0, 0, 2.49955, -3.11282, 0.396297 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 3
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
Expand Down
2 changes: 1 addition & 1 deletion inventory/item.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[sub_resource type="GDScript" id=1]

script/source = "export(int) var speedup = 0\nexport(int) var damage = 0\nexport(int) var weaponrange = 0\nexport(String) var name = \"leer\"\nexport(int) var type\n\nexport(bool) var equipped\n\nfunc getSpeedup():\n\tif(equipped):\n\t\t\n\t\treturn speedup\n\telse:\n\t\treturn 0\n\nfunc getDamage():\n\tif(equipped):\n\t\t\n\t\treturn damage\n\telse:\n\t\treturn 0\n\nfunc getRange():\n\tif(equipped):\n\t\t\n\t\treturn weaponrange\n\telse:\n\t\treturn 0\n\nfunc setStats(s,d,w):\n\tspeedup = s\n\tdamage = d\n\tweaponrange = w\n\nfunc isEquipped():\n\treturn equipped\n\nfunc _ready():\n\tsetTooltip()\n\tpass\n\nfunc setName(n):\n\tname = n\n\t#set_tooltip(name)\n\nfunc setTooltip():\n\tvar tt = name + \"\\n\"\n\ttt+= \"Geschindigkeit: +\" + str(speedup) + \"\\n\"\n\ttt+= \"Damage: +\" + str(damage) + \"\\n\"\n\ttt+= \"Reichweite: +\" + str(weaponrange)\n\tset_tooltip(tt)\n\nfunc equip():\n\tif(equipped):\n\t\tprint(\"\")\n\t\tequipped = false\n\t\tset_tooltip(name)\n\t\tprint(name)\n\t\t#self.set_pos(pos)#\n\t\tset_opacity(1)\n\telse:\n\t\tequipped = true\n\t\tset_opacity(0.2)\n\t\t#print (\"equip()\")\n\t"
script/source = "export(int) var speedup = 0\nexport(int) var damage = 0\nexport(int) var weaponrange = 0\n\nexport(String) var name = \"leer\"\nexport(int) var type\n\nexport(bool) var equipped\n\nfunc getSpeedup():\n\tif(equipped):\n\t\t\n\t\treturn speedup\n\telse:\n\t\treturn 0\n\nfunc getDamage():\n\tif(equipped):\n\t\t\n\t\treturn damage\n\telse:\n\t\treturn 0\n\nfunc getRange():\n\tif(equipped):\n\t\t\n\t\treturn weaponrange\n\telse:\n\t\treturn 0\n\nfunc setStats(s,d,w):\n\tspeedup = s\n\tdamage = d\n\tweaponrange = w\n\nfunc isEquipped():\n\treturn equipped\n\nfunc _ready():\n\tsetTooltip()\n\tpass\n\nfunc setName(n):\n\tname = n\n\t#set_tooltip(name)\n\nfunc setTooltip():\n\tvar tt = name + \"\\n\"\n\ttt+= \"Geschindigkeit: +\" + str(speedup) + \"\\n\"\n\ttt+= \"Damage: +\" + str(damage) + \"\\n\"\n\ttt+= \"Reichweite: +\" + str(weaponrange)\n\tif(equipped):\n\t\ttt+= \"\\n(equipped)\"\n\tset_tooltip(tt)\n\nfunc equip():\n\tif(equipped):\n\n\t\tsetTooltip()\n\t\tset_opacity(1)\n\telse:\n\t\tequipped = true\n\t\tset_opacity(0.2)\n\t\tsetTooltip()\n\t\t#print (\"equip()\")\n\t"

[node name="item" type="TextureButton"]

Expand Down
3 changes: 3 additions & 0 deletions menu/menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ textures/normal = ExtResource( 1 )

[node name="options" type="TextureButton" parent="."]

visibility/opacity = 0.5
hint/tooltip = "SOON!!!\n"
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
Expand All @@ -38,6 +40,7 @@ margin/left = 606.0
margin/top = 73.0
margin/right = 856.0
margin/bottom = 173.0
disabled = true
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
Expand Down

0 comments on commit 3147675

Please sign in to comment.