| @@ -0,0 +1,90 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <resource_file type="PackedScene" subresource_count="7" version="2.1" version_name="Godot Engine v2.1.stable.official"> | ||
| <ext_resource path="res://Graphics/UI/ui_bg.tex" type="Texture" index="0"></ext_resource> | ||
| <ext_resource path="res://Graphics/UI/title.tex" type="Texture" index="5"></ext_resource> | ||
| <ext_resource path="res://Scripts/toGame.gd" type="Script" index="1"></ext_resource> | ||
| <ext_resource path="res://Scripts/toControls.gd" type="Script" index="3"></ext_resource> | ||
| <ext_resource path="res://Scripts/toExit.gd" type="Script" index="4"></ext_resource> | ||
| <ext_resource path="res://Scripts/toInstructions.gd" type="Script" index="2"></ext_resource> | ||
| <main_resource> | ||
| <dictionary name="_bundled" shared="false"> | ||
| <string> "conn_count" </string> | ||
| <int> 0 </int> | ||
| <string> "conns" </string> | ||
| <int_array len="0"> </int_array> | ||
| <string> "editable_instances" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "names" </string> | ||
| <string_array len="26"> | ||
| <string> "TextureFrame" </string> | ||
| <string> "anchor/right" </string> | ||
| <string> "anchor/bottom" </string> | ||
| <string> "focus/ignore_mouse" </string> | ||
| <string> "focus/stop_mouse" </string> | ||
| <string> "size_flags/horizontal" </string> | ||
| <string> "size_flags/vertical" </string> | ||
| <string> "margin/left" </string> | ||
| <string> "margin/top" </string> | ||
| <string> "margin/right" </string> | ||
| <string> "margin/bottom" </string> | ||
| <string> "texture" </string> | ||
| <string> "expand" </string> | ||
| <string> "stretch_mode" </string> | ||
| <string> "toGame" </string> | ||
| <string> "toggle_mode" </string> | ||
| <string> "enabled_focus_mode" </string> | ||
| <string> "shortcut" </string> | ||
| <string> "text" </string> | ||
| <string> "flat" </string> | ||
| <string> "script/script" </string> | ||
| <string> "Button" </string> | ||
| <string> "toInstructions" </string> | ||
| <string> "toControls" </string> | ||
| <string> "toExit" </string> | ||
| <string> "anchor/top" </string> | ||
| </string_array> | ||
| <string> "node_count" </string> | ||
| <int> 6 </int> | ||
| <string> "node_paths" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "nodes" </string> | ||
| <int_array len="224"> -1, -1, 0, 0, -1, 13, 1, 0, 2, 0, 3, 1, 4, 1, 5, 2, 6, 2, 7, 3, 8, 3, 9, 3, 10, 3, 11, 4, 12, 1, 13, 5, 0, 0, 0, 21, 14, -1, 16, 1, 0, 2, 0, 3, 6, 4, 1, 5, 2, 6, 2, 7, 7, 8, 8, 9, 7, 10, 9, 15, 6, 16, 2, 17, 10, 18, 11, 19, 6, 20, 12, 0, 0, 0, 21, 22, -1, 16, 1, 0, 2, 0, 3, 6, 4, 1, 5, 2, 6, 2, 7, 7, 8, 13, 9, 7, 10, 14, 15, 6, 16, 2, 17, 10, 18, 15, 19, 6, 20, 16, 0, 0, 0, 21, 23, -1, 16, 1, 0, 2, 0, 3, 6, 4, 1, 5, 2, 6, 2, 7, 7, 8, 17, 9, 7, 10, 18, 15, 6, 16, 2, 17, 10, 18, 19, 19, 6, 20, 20, 0, 0, 0, 21, 24, -1, 16, 1, 0, 2, 0, 3, 6, 4, 1, 5, 2, 6, 2, 7, 7, 8, 7, 9, 7, 10, 21, 15, 6, 16, 2, 17, 10, 18, 22, 19, 6, 20, 23, 0, 0, 0, 0, 0, -1, 14, 25, 24, 1, 0, 2, 24, 3, 1, 4, 1, 5, 2, 6, 2, 7, 25, 8, 26, 9, 25, 10, 27, 11, 28, 12, 1, 13, 5, 0 </int_array> | ||
| <string> "variants" </string> | ||
| <array len="29" shared="false"> | ||
| <int> 1 </int> | ||
| <bool> True </bool> | ||
| <int> 2 </int> | ||
| <real> 0 </real> | ||
| <resource external="0"> </resource> | ||
| <int> 0 </int> | ||
| <bool> False </bool> | ||
| <real> 350 </real> | ||
| <real> 215 </real> | ||
| <real> 353 </real> | ||
| <resource name=""></resource> <string> "Play" </string> | ||
| <resource external="1"> </resource> | ||
| <real> 260 </real> | ||
| <real> 308 </real> | ||
| <string> "Instructions" </string> | ||
| <resource external="2"> </resource> | ||
| <real> 305 </real> | ||
| <real> 263 </real> | ||
| <string> "Controls" </string> | ||
| <resource external="3"> </resource> | ||
| <real> 218 </real> | ||
| <string> "Quit" </string> | ||
| <resource external="4"> </resource> | ||
| <int> 3 </int> | ||
| <real> 25 </real> | ||
| <real> 240 </real> | ||
| <real> 170 </real> | ||
| <resource external="5"> </resource> | ||
| </array> | ||
| <string> "version" </string> | ||
| <int> 2 </int> | ||
| </dictionary> | ||
|
|
||
| </main_resource> | ||
| </resource_file> |
| @@ -0,0 +1,44 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <resource_file type="PackedScene" subresource_count="4" version="2.1" version_name="Godot Engine v2.1.stable.official"> | ||
| <ext_resource path="res://Scenes/Defender.xml" type="PackedScene" index="2"></ext_resource> | ||
| <ext_resource path="res://Scenes/Attacker.tscn" type="PackedScene" index="1"></ext_resource> | ||
| <ext_resource path="res://Scripts/worldControl.gd" type="Script" index="0"></ext_resource> | ||
| <main_resource> | ||
| <dictionary name="_bundled" shared="false"> | ||
| <string> "conn_count" </string> | ||
| <int> 0 </int> | ||
| <string> "conns" </string> | ||
| <int_array len="0"> </int_array> | ||
| <string> "editable_instances" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "names" </string> | ||
| <string_array len="6"> | ||
| <string> "World" </string> | ||
| <string> "script/script" </string> | ||
| <string> "Node2D" </string> | ||
| <string> "Attacker" </string> | ||
| <string> "transform/pos" </string> | ||
| <string> "Defender" </string> | ||
| </string_array> | ||
| <string> "node_count" </string> | ||
| <int> 3 </int> | ||
| <string> "node_paths" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "nodes" </string> | ||
| <int_array len="27"> -1, -1, 2, 0, -1, 1, 1, 0, 0, 0, 0, 2147483647, 3, 1, 1, 4, 2, 0, 0, 0, 2147483647, 5, 3, 1, 4, 4, 0 </int_array> | ||
| <string> "variants" </string> | ||
| <array len="5" shared="false"> | ||
| <resource external="0"> </resource> | ||
| <resource external="1"> </resource> | ||
| <vector2> 278.874, 90.224 </vector2> | ||
| <resource external="2"> </resource> | ||
| <vector2> 276.824, 170.195 </vector2> | ||
| </array> | ||
| <string> "version" </string> | ||
| <int> 2 </int> | ||
| </dictionary> | ||
|
|
||
| </main_resource> | ||
| </resource_file> |
| @@ -0,0 +1,78 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <resource_file type="PackedScene" subresource_count="3" version="2.1" version_name="Godot Engine v2.1.stable.official"> | ||
| <ext_resource path="res://Scenes/World.xml" type="PackedScene" index="1"></ext_resource> | ||
| <ext_resource path="res://Graphics/UI/ui_bg.tex" type="Texture" index="0"></ext_resource> | ||
| <main_resource> | ||
| <dictionary name="_bundled" shared="false"> | ||
| <string> "conn_count" </string> | ||
| <int> 0 </int> | ||
| <string> "conns" </string> | ||
| <int_array len="0"> </int_array> | ||
| <string> "editable_instances" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "names" </string> | ||
| <string_array len="26"> | ||
| <string> "TextureFrame" </string> | ||
| <string> "anchor/right" </string> | ||
| <string> "anchor/bottom" </string> | ||
| <string> "focus/ignore_mouse" </string> | ||
| <string> "focus/stop_mouse" </string> | ||
| <string> "size_flags/horizontal" </string> | ||
| <string> "size_flags/vertical" </string> | ||
| <string> "margin/left" </string> | ||
| <string> "margin/top" </string> | ||
| <string> "margin/right" </string> | ||
| <string> "margin/bottom" </string> | ||
| <string> "texture" </string> | ||
| <string> "expand" </string> | ||
| <string> "stretch_mode" </string> | ||
| <string> "World" </string> | ||
| <string> "Panel" </string> | ||
| <string> "editor/display_folded" </string> | ||
| <string> "Label1" </string> | ||
| <string> "text" </string> | ||
| <string> "align" </string> | ||
| <string> "valign" </string> | ||
| <string> "uppercase" </string> | ||
| <string> "percent_visible" </string> | ||
| <string> "lines_skipped" </string> | ||
| <string> "max_lines_visible" </string> | ||
| <string> "Label" </string> | ||
| </string_array> | ||
| <string> "node_count" </string> | ||
| <int> 5 </int> | ||
| <string> "node_paths" </string> | ||
| <array len="0" shared="false"> | ||
| </array> | ||
| <string> "nodes" </string> | ||
| <int_array len="143"> -1, -1, 0, 0, -1, 13, 1, 0, 2, 0, 3, 1, 4, 1, 5, 2, 6, 2, 7, 3, 8, 3, 9, 3, 10, 3, 11, 4, 12, 1, 13, 5, 0, 0, 0, 2147483647, 14, 6, 0, 0, 0, 0, 15, 15, -1, 9, 16, 1, 3, 7, 4, 1, 5, 2, 6, 2, 7, 3, 8, 3, 9, 8, 10, 9, 0, 2, 0, 25, 17, -1, 17, 1, 0, 2, 0, 3, 1, 4, 1, 5, 2, 6, 5, 7, 10, 8, 11, 9, 10, 10, 12, 18, 13, 19, 0, 20, 0, 21, 1, 22, 14, 23, 5, 24, 15, 0, 2, 0, 25, 25, -1, 15, 3, 1, 4, 1, 5, 2, 6, 5, 7, 3, 8, 16, 9, 17, 10, 18, 18, 19, 19, 0, 20, 0, 21, 1, 22, 14, 23, 5, 24, 15, 0 </int_array> | ||
| <string> "variants" </string> | ||
| <array len="20" shared="false"> | ||
| <int> 1 </int> | ||
| <bool> True </bool> | ||
| <int> 2 </int> | ||
| <real> 0 </real> | ||
| <resource external="0"> </resource> | ||
| <int> 0 </int> | ||
| <resource external="1"> </resource> | ||
| <bool> False </bool> | ||
| <real> 95 </real> | ||
| <real> 68 </real> | ||
| <real> 5 </real> | ||
| <real> 36 </real> | ||
| <real> -3 </real> | ||
| <string> "GEMS: 0" </string> | ||
| <real> 1 </real> | ||
| <int> -1 </int> | ||
| <real> 3 </real> | ||
| <real> 93 </real> | ||
| <real> 42 </real> | ||
| <string> "Score: 0" </string> | ||
| </array> | ||
| <string> "version" </string> | ||
| <int> 2 </int> | ||
| </dictionary> | ||
|
|
||
| </main_resource> | ||
| </resource_file> |
| @@ -0,0 +1,25 @@ | ||
| extends Node2D | ||
|
|
||
| # class member variables go here, for example: | ||
| # var a = 2 | ||
| # var b = "textvar" | ||
| var height = 650 | ||
| var speed = 5 | ||
|
|
||
|
|
||
| func _ready(): | ||
| # Called every time the node is added to the scene. | ||
| # Initialization here | ||
| set_fixed_process(true) | ||
|
|
||
| func _fixed_process(delta): | ||
|
|
||
| #The laser's is moving downwards using KinematicBody2D | ||
| get_node("KinematicBody2D").move(Vector2(0,speed)) | ||
|
|
||
|
|
||
| #The laser reached a certain position on screen | ||
| if get_node("KinematicBody2D").get_global_pos().y > height: | ||
| #this deletes the tree structure of Laser. | ||
| get_node(".").queue_free() | ||
|
|
| @@ -0,0 +1,43 @@ | ||
| extends Node2D | ||
|
|
||
| # class member variables go here, for example: | ||
| var firePressed = false | ||
| var laserObject = preload("res://Scenes/Laser.tscn") | ||
| var laserCount = 0 | ||
| var laserOffset = 0 | ||
|
|
||
| func _ready(): | ||
| # Called every time the node is added to the scene. | ||
| # Initialization here | ||
| set_process(true) | ||
|
|
||
| func _process(delta): | ||
|
|
||
| #user pressed spacebar | ||
| if Input.is_action_pressed("ui_select") and !firePressed: | ||
| laserCount += 1 | ||
|
|
||
| #create a copy of the laser object | ||
| var laserInstance = laserObject.instance() | ||
| var laserInstance2 = laserObject.instance() | ||
|
|
||
| #give the copy a name | ||
| laserInstance.set_name("Laser" + str(laserCount)) | ||
| laserInstance2.set_name("Laser" + str(laserCount+1)) | ||
|
|
||
| #add a child | ||
| add_child(laserInstance) | ||
| add_child(laserInstance2) | ||
| laserInstance.set_owner(self) | ||
| laserInstance2.set_owner(self) | ||
|
|
||
| #set the position of the laser copy | ||
| laserInstance.set_global_pos(get_node("KinematicBody2D/ShipSprite").get_global_pos() + Vector2(24,24)) | ||
| laserInstance2.set_global_pos(get_node("KinematicBody2D/ShipSprite").get_global_pos() + Vector2(-24,24)) | ||
|
|
||
| #make a collision exception with the attacker | ||
| #get_node("Laser" + str(laserCount) + "/KinematicBody2D").add_collision_exception_with(get_node("KinematicBody2D")) | ||
|
|
||
|
|
||
| #Check to see if user pressed the spacebar | ||
| firePressed = Input.is_action_pressed("ui_select") |
| @@ -0,0 +1,35 @@ | ||
|
|
||
| extends KinematicBody2D | ||
|
|
||
| export var MOTION_SPEED = 140 | ||
| var RayNode | ||
|
|
||
| func _ready(): | ||
| # Called every time the node is added to the scene. | ||
| # Initialization here | ||
| set_fixed_process(true) | ||
| RayNode = get_node("RayCast2D") | ||
|
|
||
| func _fixed_process(delta): | ||
| var motion = Vector2() | ||
|
|
||
| #motion | ||
| if (Input.is_action_pressed("ui_up")): | ||
| motion += Vector2(0,-1) | ||
| RayNode.set_rotd(180) | ||
|
|
||
| if (Input.is_action_pressed("ui_down")): | ||
| motion += Vector2(0,1) | ||
| RayNode.set_rotd(0) | ||
|
|
||
| if (Input.is_action_pressed("ui_left")): | ||
| motion += Vector2(-1,0) | ||
| RayNode.set_rotd(-90) | ||
|
|
||
| if (Input.is_action_pressed("ui_right")): | ||
| motion += Vector2(1,0) | ||
| RayNode.set_rotd(90) | ||
|
|
||
| motion = motion.normalized() * MOTION_SPEED * delta | ||
| move( motion ) | ||
|
|
| @@ -0,0 +1,31 @@ | ||
| extends KinematicBody2D | ||
|
|
||
| # class member variables go here, for example: | ||
| var btn_right = false | ||
| var btn_left = false | ||
|
|
||
|
|
||
| var current_speed = Vector2(0,0) | ||
| export var player_speed = 5 | ||
|
|
||
|
|
||
| #set_linear_velocity(Vector2(current_speed.x,0)) | ||
| func movement(speed): | ||
| current_speed.x = speed | ||
| move(current_speed) | ||
| get_node("ShipSprite").set_pos(get_pos()) | ||
| #translate(current_speed) | ||
|
|
||
| func _ready(): | ||
| # Called every time the node is added to the scene. | ||
| # Initialization here | ||
| set_fixed_process(true) | ||
|
|
||
| func _fixed_process(delta): | ||
| btn_right = Input.is_action_pressed("ui_right") | ||
| btn_left = Input.is_action_pressed("ui_left") | ||
|
|
||
| if btn_right: | ||
| movement(player_speed) | ||
| if btn_left: | ||
| movement(-player_speed) |
| @@ -0,0 +1,14 @@ | ||
|
|
||
| extends Button | ||
|
|
||
| func _ready(): | ||
| set_process_input(true) | ||
|
|
||
|
|
||
|
|
||
| func _pressed(): | ||
| #change current scene to "controls.xml" | ||
| print(" >> How To Play >> ") | ||
| get_tree().change_scene("res://Scenes/Controls.xml") | ||
| pass | ||
|
|
| @@ -0,0 +1,13 @@ | ||
|
|
||
| extends Button | ||
|
|
||
| func _ready(): | ||
| set_process_input(true) | ||
|
|
||
|
|
||
|
|
||
| func _pressed(): | ||
| #quits game | ||
| print("Quit!") | ||
| get_tree().quit() | ||
|
|
| @@ -0,0 +1,14 @@ | ||
|
|
||
| extends Button | ||
|
|
||
| func _ready(): | ||
| set_process_input(true) | ||
|
|
||
|
|
||
|
|
||
| func _pressed(): | ||
| #change current scene to "mainScene.xml" | ||
| print("Play Game!") | ||
| get_tree().change_scene("res://Scenes/WorldInterface.xml") | ||
| pass | ||
|
|
| @@ -0,0 +1,15 @@ | ||
|
|
||
| extends Button | ||
|
|
||
| func _ready(): | ||
| set_process_input(true) | ||
|
|
||
|
|
||
|
|
||
| func _pressed(): | ||
| #change current scene to "instructions.xml" | ||
| print(" >> What To Play >> ") | ||
| get_tree().change_scene("res://Scenes/Instructions.xml") | ||
| pass | ||
|
|
||
|
|
| @@ -0,0 +1,12 @@ | ||
|
|
||
| extends Node2D | ||
|
|
||
| func _ready(): | ||
| set_process_input(true) | ||
|
|
||
| func _input(event): | ||
| #go to start scene if "Q" pressed | ||
| if (event.type == InputEvent.KEY): | ||
| if (event.scancode == KEY_Q && event.pressed == false): | ||
| # 'Q' key released | ||
| get_tree().change_scene("res://Scenes/Start.xml") |
| @@ -0,0 +1,14 @@ | ||
| image loader=false | ||
|
|
||
| [application] | ||
|
|
||
| name="test" | ||
| main_scene="res://Scenes/Start.xml" | ||
| icon="res://icon.png" | ||
|
|
||
| [display] | ||
|
|
||
| width=800 | ||
| height=600 | ||
| stretch_mode="2d" | ||
| stretch_aspect="keep_height" |
| @@ -0,0 +1 @@ | ||
| gen_mipmaps=false |