From 1a7ff9cd96629b8a7d2e5ef825e78aff361e5529 Mon Sep 17 00:00:00 2001 From: Joa2 Date: Thu, 16 Nov 2023 15:07:24 +0100 Subject: [PATCH] Added basic region pathfinfing networking, transfering region info such as tiles and units works, but no moves can be requested yet. --- ...e.png-25669cdb99469b4149cec015f84e52b1.md5 | 3 + ....png-25669cdb99469b4149cec015f84e52b1.stex | Bin 0 -> 194 bytes ...e.png-9720aced28368a22298ccaf2a68942cc.md5 | 3 + ....png-9720aced28368a22298ccaf2a68942cc.stex | Bin 0 -> 178 bytes ...e.png-87c11b1469a9d84d4f76a51d1203572a.md5 | 3 + ....png-87c11b1469a9d84d4f76a51d1203572a.stex | Bin 0 -> 132 bytes ...e.png-efca2ee418235964b71d2c06816282db.md5 | 3 + ....png-efca2ee418235964b71d2c06816282db.stex | Bin 0 -> 136 bytes ...e.png-039fc52b1d6966267896d4c3bf84548a.md5 | 3 + ....png-039fc52b1d6966267896d4c3bf84548a.stex | Bin 0 -> 134 bytes ...t.png-33f6792a5bb8046827aa692c8732e313.md5 | 3 + ....png-33f6792a5bb8046827aa692c8732e313.stex | Bin 0 -> 136 bytes Client/Camera2D.gd | 6 +- Client/autoloads/Network.gd | 7 +- Client/autoloads/WorldManager.gd | 20 +-- Client/region/LineManager.gd | 102 +++++++++++++ Client/region/Region.gd | 28 ++-- Client/region/Region.tscn | 134 ++++++------------ Client/region/RegionTiles.tres | 49 +++++++ Client/region/SuperUnit.gd | 75 ++++++++++ Client/region/SuperUnit.tscn | 12 ++ Client/region/TileMap.gd | 22 +++ ... Kopie - Kopie - Kopie - Kopie - Kopie.png | Bin 0 -> 4610 bytes ...- Kopie - Kopie - Kopie - Kopie.png.import | 35 +++++ ...enannt - Kopie - Kopie - Kopie - Kopie.png | Bin 0 -> 4549 bytes ...- Kopie - Kopie - Kopie - Kopie.png.import | 35 +++++ .../Unbenannt - Kopie - Kopie - Kopie.png | Bin 0 -> 4546 bytes ...benannt - Kopie - Kopie - Kopie.png.import | 35 +++++ Client/region/Unbenannt - Kopie - Kopie.png | Bin 0 -> 4555 bytes .../Unbenannt - Kopie - Kopie.png.import | 35 +++++ Client/region/Unbenannt - Kopie.png | Bin 0 -> 4551 bytes Client/region/Unbenannt - Kopie.png.import | 35 +++++ Client/region/Unbenannt.png | Bin 0 -> 3723 bytes Client/region/Unbenannt.png.import | 35 +++++ Client/region/Unit.gd | 64 +++++++++ Client/region/Unit.tscn | 11 ++ Server/autoloads/Network.gd | 9 +- Server/autoloads/PlayerManager.gd | 5 +- Server/autoloads/WorldManager.gd | 18 ++- Server/menues/Main Menue.tscn | 3 - Server/region/Region.gd | 4 +- 41 files changed, 656 insertions(+), 141 deletions(-) create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.md5 create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.stex create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie.png-9720aced28368a22298ccaf2a68942cc.md5 create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie.png-9720aced28368a22298ccaf2a68942cc.stex create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.md5 create mode 100644 Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.stex create mode 100644 Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.md5 create mode 100644 Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.stex create mode 100644 Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.md5 create mode 100644 Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.stex create mode 100644 Client/.import/Unbenannt.png-33f6792a5bb8046827aa692c8732e313.md5 create mode 100644 Client/.import/Unbenannt.png-33f6792a5bb8046827aa692c8732e313.stex create mode 100644 Client/region/LineManager.gd create mode 100644 Client/region/RegionTiles.tres create mode 100644 Client/region/SuperUnit.gd create mode 100644 Client/region/SuperUnit.tscn create mode 100644 Client/region/TileMap.gd create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png.import create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie.png create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie.png.import create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie.png create mode 100644 Client/region/Unbenannt - Kopie - Kopie - Kopie.png.import create mode 100644 Client/region/Unbenannt - Kopie - Kopie.png create mode 100644 Client/region/Unbenannt - Kopie - Kopie.png.import create mode 100644 Client/region/Unbenannt - Kopie.png create mode 100644 Client/region/Unbenannt - Kopie.png.import create mode 100644 Client/region/Unbenannt.png create mode 100644 Client/region/Unbenannt.png.import create mode 100644 Client/region/Unit.gd create mode 100644 Client/region/Unit.tscn diff --git a/Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.md5 b/Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.md5 new file mode 100644 index 0000000..b476fcb --- /dev/null +++ b/Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.md5 @@ -0,0 +1,3 @@ +source_md5="60fad784db3412e499a61e159fb0ab54" +dest_md5="8f21de330736bfda6b5c832cb18acbb8" + diff --git a/Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.stex b/Client/.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.stex new file mode 100644 index 0000000000000000000000000000000000000000..e2bbbae6914d1bd6e332075ca8c7bc87d82636d8 GIT binary patch literal 194 zcmZ>F2@YvsVPNQBVqgGLK%l_R2qc#Qak#5fK#-@K+bk$MEWpC256IT9KeCWPTtUF& z)AL)|yp0Z%?61dhvrPK4^IO$F=6X?sEaj6Io9?J>JQ3#n`I7m3L&E>_xj==wLSlT&LF2@YvsVPNQBVqgGLK%l_R2qdQgak#5fK#-@KTNjia7GU913uNopA6dvCt{~vy zbiam|(eYx*c}|Y5Wz~8AnCnF~vQ#vkR4Pu O^0&nQ&-UaapxXev5m15v literal 0 HcmV?d00001 diff --git a/Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.md5 b/Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.md5 new file mode 100644 index 0000000..544a8b5 --- /dev/null +++ b/Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.md5 @@ -0,0 +1,3 @@ +source_md5="97cea05c45971cc8ae3f0dbb70b26d39" +dest_md5="e9948a9e9f2c54d77ffbc60b4cf29da7" + diff --git a/Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.stex b/Client/.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.stex new file mode 100644 index 0000000000000000000000000000000000000000..9f37e1d4303b930b5596092e6c9717839f5bef66 GIT binary patch literal 132 zcmZ>F2@YvsVPNQBVqgGLK%l_R2qZIrINa4KAjs3rEe6UC3$XAB0J8P#k1S;1H~9bA z{{LtBiUb+YAZa6o|8F{u92T!Eb@{KZpi_MF=x=we%O~nDh)(-%`0sf=ZuGyt0RS3z BITQc@ literal 0 HcmV?d00001 diff --git a/Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.md5 b/Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.md5 new file mode 100644 index 0000000..fc2050c --- /dev/null +++ b/Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.md5 @@ -0,0 +1,3 @@ +source_md5="4649619802d7e43bcb178d0ca22d8f87" +dest_md5="7afddab8fa81674668efb848afc5a75e" + diff --git a/Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.stex b/Client/.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.stex new file mode 100644 index 0000000000000000000000000000000000000000..914a69ec02aae2a7aaa26a1b5eb687bffdb911af GIT binary patch literal 136 zcmZ>F2@YvsVPNQBVqgGLK%l_R2qbfWINa4KAjs3rEdk073$XAB2D0_*k1S;1|Iqh; z_y7G*>i<1v>{0g2VxBmmzAWXzPo?#JFaEPkN#)sH@!unH)=&Ojr#{&o`~T-WZuFmD GfB^smqCm$0 literal 0 HcmV?d00001 diff --git a/Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.md5 b/Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.md5 new file mode 100644 index 0000000..189c7bc --- /dev/null +++ b/Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.md5 @@ -0,0 +1,3 @@ +source_md5="f2f86a04a5e4e9f760d7a35d7a636bd9" +dest_md5="93f1454ca0c6306e7a64849450c73751" + diff --git a/Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.stex b/Client/.import/Unbenannt - Kopie.png-039fc52b1d6966267896d4c3bf84548a.stex new file mode 100644 index 0000000000000000000000000000000000000000..55e3e3bb300cb6d6e1f6287c5f0a48b86d66db64 GIT binary patch literal 134 zcmZ>F2@YvsVPNQBVqgGLK%l_R2qd$BINa4KAjs3rEe^^K3$XAB0F2@YvsVPNQBVqgGLK%l_R2qbfWINa4KAjs3rEdk073$XAB2D0_*k1S;1FSz-? z|IhxH_5U6-_9%O1F;AROUzYOVr_%bq7yntNr1I>p`0tT8>nH!NQ=jaP{r__wH~P;n GzyJW}$UtZS literal 0 HcmV?d00001 diff --git a/Client/Camera2D.gd b/Client/Camera2D.gd index 7e55d0d..691c37f 100644 --- a/Client/Camera2D.gd +++ b/Client/Camera2D.gd @@ -41,9 +41,9 @@ func _ready(): func _process(delta): #smooth movement var inpx = (int(Input.is_action_pressed("ui_right")) - - int(Input.is_action_pressed("ui_left"))) + - int(Input.is_action_pressed("ui_left"))) var inpy = (int(Input.is_action_pressed("ui_down")) - - int(Input.is_action_pressed("ui_up"))) + - int(Input.is_action_pressed("ui_up"))) self.position.x = lerp(position.x, position.x + inpx *speed,speed * delta) self.position.y = lerp(position.y, position.y + inpy *speed,speed * delta) if Input.is_key_pressed(KEY_CONTROL): @@ -127,4 +127,4 @@ func _input(event): if event is InputEventMouse: mousepos = event.position - mouseposGlobal = get_global_mouse_position() \ No newline at end of file + mouseposGlobal = get_global_mouse_position() diff --git a/Client/autoloads/Network.gd b/Client/autoloads/Network.gd index bae6096..b2e1125 100644 --- a/Client/autoloads/Network.gd +++ b/Client/autoloads/Network.gd @@ -18,8 +18,9 @@ signal server_disconnected func _ready(): get_tree().connect('network_peer_disconnected', self, '_on_player_disconnected') get_tree().connect('network_peer_connected', self, '_on_player_connected') - - + connect_to_server("name","","") + yield(get_tree().create_timer(1),"timeout") + rpc_id(1, 'TESTFUNCTION', "TEST TEST TEST") func connect_to_server(playerName,pw,serverpassword): self.serverpassword = serverpassword @@ -33,7 +34,6 @@ func connect_to_server(playerName,pw,serverpassword): # PlayerManager.authcache['password']=pw # PlayerManager.authcache['playername']=playerName - func _connected_to_server(): var local_player_id = get_tree().get_network_unique_id() players[local_player_id] = self_data @@ -44,7 +44,6 @@ func _connected_to_server(): rpc_id(1, '_request_auth', local_player_id, self_data)# anstatt playerName und pw -> self_data rpc('_send_player_info', local_player_id, self_data) # requests all player in the current session - func _on_player_disconnected(id): players.erase(id) PlayerManager.player_disconnected(id) diff --git a/Client/autoloads/WorldManager.gd b/Client/autoloads/WorldManager.gd index 0067415..a82b6ec 100644 --- a/Client/autoloads/WorldManager.gd +++ b/Client/autoloads/WorldManager.gd @@ -232,13 +232,13 @@ func _load_worldmap(): - func requestTiles(unit = null): + print("a") rpc_id(1, 'requestTiles', unit) signal receiveTiles -func receiveTiles(bundledTileStuff): +remote func receiveTiles(bundledTileStuff): var newTileRect = bundledTileStuff[0] var newTiles = bundledTileStuff[1] var newSuperTiles = bundledTileStuff[2] @@ -249,19 +249,5 @@ func requestUnits(): signal receiveUnits -func receiveUnits(newBoardUnits): - var boardUnits = newBoardUnits - for child in $TileMap/Units.get_children(): - child.queue_free() - var boardUnitsIndex = 0 - for unit in boardUnits: - var newUnit - if unit.superUnit: - newUnit = (load("res://SuperUnit.tscn")).instance() - else: - newUnit = (load("res://Unit.tscn")).instance() - newUnit.boardUnitsIndex = boardUnitsIndex - $TileMap/Units.add_child(newUnit) - newUnit.on_ready() - boardUnitsIndex +=1 +remote func receiveUnits(newBoardUnits): emit_signal("receiveUnits", newBoardUnits) diff --git a/Client/region/LineManager.gd b/Client/region/LineManager.gd new file mode 100644 index 0000000..23c0df2 --- /dev/null +++ b/Client/region/LineManager.gd @@ -0,0 +1,102 @@ +extends Node2D + +var red = Color( 1, 0, 0, 1 ) +var yellow = Color( 1, 1, 0, 1 ) +var blue = Color( 0, 1, 1, 1 ) + +var route1 = []#blue line +var route2 = []#yellow line +var route3 = []#redline +var vertices1 = []#blue line +var vertices2 = []#yellow line +var vertices3 = []#redline + +func _ready():#this sets colors to the different lines + $Line1.default_color = blue + $Line2.default_color = yellow + $Line3.default_color = red + +func drawAdvancedLine(route, vertices, unitAp, unitMoveAp):#this creates the seperate lines and draws them + route1 = [] + route2 = [] + route3 = [] + vertices1 = [] + vertices2 = [] + vertices3 = [] + #blue + route1 = route.duplicate() + vertices1 = vertices.duplicate() + while addUpArray(vertices1) > unitMoveAp: + route1.pop_back() + vertices1.pop_back() + #yellow + route2 = route.duplicate() + vertices2 = vertices.duplicate() + while addUpArray(vertices2) > unitMoveAp+unitAp: + route2.pop_back() + vertices2.pop_back() + #red + route3 = route.duplicate() + vertices3 = vertices.duplicate() + subtractPaths(route3, route2) + subtractPaths(route2, route1) + + $Line1.points = convertMapRouteToWorldRoute(route1) + $Line2.points = convertMapRouteToWorldRoute(route2) + $Line3.points = convertMapRouteToWorldRoute(route3) + +func addUpArray(array):#this adds up each int in an array. useful for calculating total distance. + var total = 0 + for number in array: + total += number + return(total) + +func convertMapRouteToWorldRoute(route):#this uses the map_to_world function on each coord of a route + var returnRoute = [] + for point in route: + returnRoute.append(get_parent().map_to_world(point)+Vector2(32,32)) + return(returnRoute) + +func subtractPaths(path1, path2):#this produces a path1 that only overlaps path2 in their first coord. Or something. + var lastDuplicateValue + for value in path2: + path1.erase(value) + lastDuplicateValue = value + if lastDuplicateValue != null: + path1.push_front(lastDuplicateValue) + return path1 + +func drawAdvancedSuperLine(route, vertices, unitAp, unitMoveAp):#this creates the seperate lines and draws them + route1 = [] + route2 = [] + route3 = [] + vertices1 = [] + vertices2 = [] + vertices3 = [] + #blue + route1 = route.duplicate() + vertices1 = vertices.duplicate() + while addUpArray(vertices1) > unitMoveAp: + route1.pop_back() + vertices1.pop_back() + #yellow + route2 = route.duplicate() + vertices2 = vertices.duplicate() + while addUpArray(vertices2) > unitMoveAp+unitAp: + route2.pop_back() + vertices2.pop_back() + #red + route3 = route.duplicate() + vertices3 = vertices.duplicate() + subtractPaths(route3, route2) + subtractPaths(route2, route1) + + $Line1.points = convertSuperMapRouteToWorldRoute(route1) + $Line2.points = convertSuperMapRouteToWorldRoute(route2) + $Line3.points = convertSuperMapRouteToWorldRoute(route3) + +func convertSuperMapRouteToWorldRoute(route):#this uses the map_to_world function on each coord of a route + var returnRoute = [] + for point in route: + returnRoute.append(get_parent().map_to_world(point)+Vector2(64,64)) + return(returnRoute) diff --git a/Client/region/Region.gd b/Client/region/Region.gd index 4b0480a..ff9d3fb 100644 --- a/Client/region/Region.gd +++ b/Client/region/Region.gd @@ -17,24 +17,26 @@ var routeVertices var hoveredCoords func _ready():#this mostly just builds a bunch of stuff - yield(get_tree().create_timer(0.01), "timeout") + WorldManager.connect("receiveTiles", self, "receiveTiles") + WorldManager.connect("receiveUnits", self, "receiveUnits") + yield(get_tree().create_timer(1), "timeout") buildWorld() func buildWorld(): requestTiles() requestUnits() - $TileMap.buildTileMap(tiles) func requestTiles(unit = null): - rpc_id(1, 'requestTiles', unit, self) + WorldManager.requestTiles(unit) func receiveTiles(newTileRect, newTiles, newSuperTiles): - tileRect = tileRect + tileRect = newTileRect tiles = newTiles superTiles = newSuperTiles + $TileMap.buildTileMap(tiles) func requestUnits(): - rpc_id(1, 'requestUnits', self) + WorldManager.requestUnits() func receiveUnits(newBoardUnits): boardUnits = newBoardUnits @@ -44,9 +46,9 @@ func receiveUnits(newBoardUnits): for unit in boardUnits: var newUnit if unit.superUnit: - newUnit = (load("res://SuperUnit.tscn")).instance() + newUnit = (load("res://region/SuperUnit.tscn")).instance() else: - newUnit = (load("res://Unit.tscn")).instance() + newUnit = (load("res://region/Unit.tscn")).instance() newUnit.boardUnitsIndex = boardUnitsIndex $TileMap/Units.add_child(newUnit) newUnit.on_ready() @@ -73,14 +75,14 @@ func _input(event):#this responds to any input. Has various functions depending # print("region ",boardUnits) # print("server ",server.boardUnits) if selectedUnit != null: - if event is InputEventMouseButton and Input.is_action_just_released("left_click"): + if event is InputEventMouseButton and Input.is_action_just_released("ui_left_mouse_button"): if !selectedUnit.superUnit: clickPath() else: clickSuperPath() if event is InputEventMouseMotion: if true: - hoveredCoords = event.position + hoveredCoords = (self.make_input_local(event)).position if !selectedUnit.superUnit: hoverPath() else: @@ -109,7 +111,7 @@ func clickPath():#this finalizes the selected path while calculating ap and new func hoverPath(coord = hoveredCoords):#this gets the hovered tile and tells the pathfinding to make the path and tells the line to draw the returned path if selectedUnit !=null and coord != null: - coord = $ground.world_to_map(hoveredCoords) + coord = $TileMap.world_to_map(hoveredCoords) coord.x=clamp(coord.x,0,tileRect.x-1) coord.y=clamp(coord.y,0,tileRect.y-1) if animationInProgress == false:# and occupiedTiles.has(coord) == false: #might be buggy @@ -130,7 +132,7 @@ func executePath(route, vertices):#this takes the current selected route and tel rpc_id(1, 'moveUnit', route, selectedUnit.id) var convertedRoute = [] for coords in route: - convertedRoute.append($ground.map_to_world(coords)) + convertedRoute.append($TileMap.map_to_world(coords)) selectedNode.moveOnPath(convertedRoute) animationInProgress = true clearPathingInfo() @@ -341,7 +343,7 @@ func findSuperPath(start,end): a.append(1) func hoverSuperPath(coord = hoveredCoords): - coord = $ground.world_to_map(hoveredCoords+Vector2(-32,-32)) + coord = $TileMap.world_to_map(hoveredCoords+Vector2(-32,-32)) coord.x=clamp(coord.x,0,tileRect.x-2) coord.y=clamp(coord.y,0,tileRect.y-2) if animationInProgress == false:# and occupiedTiles.has(coord) == false: #might be buggy @@ -376,7 +378,7 @@ func executeSuperPath(route, vertices):#this takes the current selected route an rpc_id(1, 'moveUnit', route, selectedUnit.id) var convertedRoute = [] for coords in route: - convertedRoute.append($ground.map_to_world(coords)) + convertedRoute.append($TileMap.map_to_world(coords)) selectedNode.moveOnPath(convertedRoute) animationInProgress = true clearPathingInfo() diff --git a/Client/region/Region.tscn b/Client/region/Region.tscn index adedd4f..8fbf9e5 100644 --- a/Client/region/Region.tscn +++ b/Client/region/Region.tscn @@ -1,106 +1,64 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://region/Region.gd" type="Script" id=1] -[ext_resource path="res://images/region/regiontiles.png" type="Texture" id=2] -[ext_resource path="res://region/regionGround.gd" type="Script" id=3] -[ext_resource path="res://army/Stack2x1.tscn" type="PackedScene" id=4] +[ext_resource path="res://region/LineManager.gd" type="Script" id=2] +[ext_resource path="res://region/TileMap.gd" type="Script" id=3] +[ext_resource path="res://region/RegionTiles.tres" type="TileSet" id=4] [ext_resource path="res://Camera2D.gd" type="Script" id=7] [ext_resource path="res://region/RegionUI.tscn" type="PackedScene" id=8] [ext_resource path="res://smallbtn.tscn" type="PackedScene" id=9] [ext_resource path="res://RecruteMenueButton.gd" type="Script" id=10] [ext_resource path="res://menues/toggleResearch.gd" type="Script" id=11] [ext_resource path="res://menues/research.tscn" type="PackedScene" id=12] -[ext_resource path="res://items/Item.tscn" type="PackedScene" id=13] - -[sub_resource type="TileSet" id=1] -0/name = "regiontiles.png 0" -0/texture = ExtResource( 2 ) -0/tex_offset = Vector2( 0, 0 ) -0/modulate = Color( 1, 1, 1, 1 ) -0/region = Rect2( 128, 0, 128, 128 ) -0/tile_mode = 0 -0/occluder_offset = Vector2( 0, 0 ) -0/navigation_offset = Vector2( 0, 0 ) -0/shape_offset = Vector2( 0, 0 ) -0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -0/shape_one_way = false -0/shape_one_way_margin = 0.0 -0/shapes = [ ] -0/z_index = 0 -1/name = "regiontiles.png 1" -1/texture = ExtResource( 2 ) -1/tex_offset = Vector2( 0, 0 ) -1/modulate = Color( 1, 1, 1, 1 ) -1/region = Rect2( 480, 0, 128, 128 ) -1/tile_mode = 0 -1/occluder_offset = Vector2( 0, 0 ) -1/navigation_offset = Vector2( 0, 0 ) -1/shape_offset = Vector2( 0, 0 ) -1/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -1/shape_one_way = false -1/shape_one_way_margin = 0.0 -1/shapes = [ ] -1/z_index = 0 -2/name = "regiontiles.png 2" -2/texture = ExtResource( 2 ) -2/tex_offset = Vector2( 0, 0 ) -2/modulate = Color( 1, 1, 1, 1 ) -2/region = Rect2( 224, 384, 128, 128 ) -2/tile_mode = 0 -2/occluder_offset = Vector2( 0, 0 ) -2/navigation_offset = Vector2( 0, 0 ) -2/shape_offset = Vector2( 0, 0 ) -2/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -2/shape_one_way = false -2/shape_one_way_margin = 0.0 -2/shapes = [ ] -2/z_index = 0 -3/name = "regiontiles.png 3" -3/texture = ExtResource( 2 ) -3/tex_offset = Vector2( 0, 0 ) -3/modulate = Color( 1, 1, 1, 1 ) -3/region = Rect2( 0, 128, 128, 128 ) -3/tile_mode = 0 -3/occluder_offset = Vector2( 0, 0 ) -3/navigation_offset = Vector2( 0, 0 ) -3/shape_offset = Vector2( 0, 0 ) -3/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -3/shape_one_way = false -3/shape_one_way_margin = 0.0 -3/shapes = [ ] -3/z_index = 0 -4/name = "regiontiles.png 4" -4/texture = ExtResource( 2 ) -4/tex_offset = Vector2( 0, 0 ) -4/modulate = Color( 1, 1, 1, 1 ) -4/region = Rect2( 128, 128, 128, 128 ) -4/tile_mode = 0 -4/occluder_offset = Vector2( 0, 0 ) -4/navigation_offset = Vector2( 0, 0 ) -4/shape_offset = Vector2( 0, 0 ) -4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) -4/shape_one_way = false -4/shape_one_way_margin = 0.0 -4/shapes = [ ] -4/z_index = 0 [node name="Region" type="Node2D"] script = ExtResource( 1 ) -[node name="ground" type="TileMap" parent="."] -tile_set = SubResource( 1 ) -cell_size = Vector2( 128, 128 ) +[node name="TileMap" type="TileMap" parent="."] +z_as_relative = false +tile_set = ExtResource( 4 ) format = 1 -tile_data = PoolIntArray( -524296, 1, 0, -524295, 1, 0, -524294, 1, 0, -524293, 1, 0, -524292, 1, 0, -524291, 1, 0, -524290, 1, 0, -524289, 1, 0, -589824, 1, 0, -589823, 1, 0, -589822, 1, 0, -589821, 1, 0, -589820, 1, 0, -589818, 1, 0, -589817, 1, 0, -589816, 1, 0, -589814, 1, 0, -589813, 1, 0, -589812, 1, 0, -589811, 1, 0, -589810, 1, 0, -589809, 1, 0, -589808, 1, 0, -589807, 1, 0, -589806, 1, 0, -589805, 1, 0, -589804, 1, 0, -589803, 1, 0, -589802, 1, 0, -458761, 1, 0, -458759, 1, 0, -458758, 1, 0, -458757, 1, 0, -458756, 1, 0, -458755, 1, 0, -458754, 1, 0, -458753, 1, 0, -524288, 1, 0, -524287, 1, 0, -524286, 1, 0, -524285, 1, 0, -524283, 1, 0, -524281, 1, 0, -524279, 1, 0, -524277, 1, 0, -524276, 1, 0, -524275, 1, 0, -524274, 1, 0, -524273, 1, 0, -524272, 1, 0, -524271, 1, 0, -524270, 1, 0, -524269, 1, 0, -524268, 1, 0, -524267, 1, 0, -524265, 1, 0, -393225, 1, 0, -393224, 1, 0, -393222, 1, 0, -393221, 1, 0, -393220, 1, 0, -393219, 1, 0, -393218, 1, 0, -393217, 1, 0, -458752, 1, 0, -458751, 1, 0, -458750, 1, 0, -458748, 1, 0, -458747, 1, 0, -458746, 1, 0, -458744, 1, 0, -458743, 1, 0, -458742, 1, 0, -458740, 1, 0, -458739, 1, 0, -458738, 1, 0, -458737, 1, 0, -458736, 1, 0, -458735, 1, 0, -458734, 1, 0, -458733, 1, 0, -458732, 1, 0, -458730, 1, 0, -458729, 1, 0, -327689, 1, 0, -327688, 1, 0, -327687, 1, 0, -327685, 1, 0, -327684, 1, 0, -327683, 1, 0, -327682, 1, 0, -327681, 1, 0, -393216, 1, 0, -393215, 1, 0, -393213, 1, 0, -393212, 1, 0, -393211, 1, 0, -393210, 1, 0, -393208, 1, 0, -393207, 1, 0, -393206, 1, 0, -393205, 1, 0, -393203, 1, 0, -393202, 1, 0, -393201, 1, 0, -393200, 1, 0, -393199, 1, 0, -393198, 1, 0, -393197, 1, 0, -393195, 1, 0, -393194, 1, 0, -393193, 1, 0, -262153, 1, 0, -262152, 1, 0, -262151, 1, 0, -262150, 1, 0, -262148, 1, 0, -262147, 1, 0, -262146, 1, 0, -262145, 1, 0, -327680, 1, 0, -327678, 1, 0, -327677, 1, 0, -327676, 1, 0, -327675, 1, 0, -327674, 1, 0, -327672, 1, 0, -327671, 1, 0, -327670, 1, 0, -327669, 1, 0, -327668, 1, 0, -327666, 1, 0, -327665, 1, 0, -327664, 1, 0, -327663, 1, 0, -327662, 1, 0, -327660, 1, 0, -327659, 1, 0, -327658, 1, 0, -327657, 1, 0, -196617, 1, 0, -196616, 1, 0, -196615, 1, 0, -196614, 1, 0, -196613, 1, 0, -196611, 1, 0, -196610, 1, 0, -196609, 1, 0, -262143, 1, 0, -262142, 1, 0, -262141, 1, 0, -262140, 1, 0, -262139, 1, 0, -262138, 1, 0, -262136, 1, 0, -262135, 1, 0, -262134, 1, 0, -262133, 1, 0, -262132, 1, 0, -262131, 1, 0, -262129, 1, 0, -262128, 1, 0, -262127, 1, 0, -262125, 1, 0, -262124, 1, 0, -262123, 1, 0, -262122, 1, 0, -262121, 1, 0, -131081, 1, 0, -131080, 1, 0, -131079, 1, 0, -131078, 1, 0, -131077, 1, 0, -131076, 1, 0, -131074, 1, 0, -196608, 1, 0, -196607, 1, 0, -196606, 1, 0, -196605, 1, 0, -196604, 1, 0, -196603, 1, 0, -196602, 1, 0, -196600, 1, 0, -196599, 1, 0, -196598, 1, 0, -196597, 1, 0, -196596, 1, 0, -196595, 1, 0, -196594, 1, 0, -196592, 1, 0, -196590, 1, 0, -196589, 1, 0, -196588, 1, 0, -196587, 1, 0, -196586, 1, 0, -196585, 1, 0, -65545, 1, 0, -65544, 1, 0, -65543, 1, 0, -65542, 1, 0, -65541, 1, 0, -65540, 1, 0, -65539, 1, 0, -65537, 1, 0, -131072, 1, 0, -131071, 1, 0, -131070, 1, 0, -131069, 1, 0, -131068, 1, 0, -131067, 1, 0, -131066, 1, 0, -131064, 1, 0, -131063, 1, 0, -131062, 1, 0, -131061, 1, 0, -131060, 1, 0, -131059, 1, 0, -131058, 1, 0, -131057, 1, 0, -131055, 1, 0, -131054, 1, 0, -131053, 1, 0, -131052, 1, 0, -131051, 1, 0, -131050, 1, 0, -131049, 1, 0, -9, 1, 0, -8, 1, 0, -7, 1, 0, -6, 1, 0, -5, 1, 0, -4, 1, 0, -2, 1, 0, -65520, 1, 0, -65518, 1, 0, -65517, 1, 0, -65516, 1, 0, -65515, 1, 0, -65514, 1, 0, -65513, 1, 0, 65527, 1, 0, 65528, 1, 0, 65529, 1, 0, 65530, 1, 0, 65531, 1, 0, 65533, 1, 0, 65534, 1, 0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 3, 2, 0, 4, 2, 0, 5, 2, 0, 6, 2, 0, 7, 2, 0, 8, 1, 0, 9, 1, 0, 10, 1, 0, 11, 1, 0, 12, 1, 0, 13, 1, 0, 14, 1, 0, 16, 1, 0, 17, 1, 0, 19, 1, 0, 20, 1, 0, 21, 1, 0, 22, 1, 0, 23, 1, 0, 131063, 1, 0, 131064, 1, 0, 131065, 1, 0, 131066, 1, 0, 131068, 1, 0, 131069, 1, 0, 131070, 1, 0, 65536, 0, 0, 65537, 0, 0, 65538, 2, 0, 65539, 2, 0, 65540, 2, 0, 65541, 2, 0, 65542, 2, 0, 65543, 2, 0, 65544, 1, 0, 65545, 1, 0, 65546, 1, 0, 65547, 1, 0, 65548, 1, 0, 65549, 1, 0, 65550, 1, 0, 65552, 1, 0, 65553, 1, 0, 65554, 1, 0, 65556, 1, 0, 65557, 1, 0, 65558, 1, 0, 65559, 1, 0, 196600, 1, 0, 196601, 1, 0, 196603, 1, 0, 196604, 1, 0, 196605, 1, 0, 196606, 1, 0, 131072, 0, 0, 131073, 0, 0, 131074, 2, 0, 131075, 4, 0, 131076, 4, 0, 131077, 0, 0, 131078, 2, 0, 131079, 2, 0, 131080, 1, 0, 131081, 1, 0, 131082, 1, 0, 131083, 1, 0, 131084, 1, 0, 131085, 1, 0, 131086, 1, 0, 131088, 1, 0, 131089, 1, 0, 131090, 1, 0, 131091, 1, 0, 131093, 1, 0, 131094, 1, 0, 262135, 1, 0, 262138, 1, 0, 262139, 1, 0, 262140, 1, 0, 262141, 1, 0, 262142, 1, 0, 196608, 4, 0, 196609, 4, 0, 196610, 4, 0, 196611, 4, 0, 196612, 4, 0, 196613, 0, 0, 196614, 2, 0, 196615, 2, 0, 196616, 1, 0, 196617, 1, 0, 196618, 1, 0, 196619, 1, 0, 196620, 1, 0, 196621, 1, 0, 196622, 1, 0, 196624, 1, 0, 196625, 1, 0, 196626, 1, 0, 196627, 1, 0, 196628, 1, 0, 196631, 1, 0, 327671, 1, 0, 327674, 1, 0, 327675, 1, 0, 327676, 1, 0, 327677, 1, 0, 327678, 1, 0, 262144, 0, 0, 262145, 0, 0, 262146, 3, 0, 262147, 3, 0, 262148, 3, 0, 262149, 0, 0, 262150, 1, 0, 262151, 1, 0, 262152, 1, 0, 262153, 1, 0, 262154, 1, 0, 262155, 1, 0, 262156, 1, 0, 262157, 1, 0, 262160, 1, 0, 262161, 1, 0, 262162, 1, 0, 262163, 1, 0, 262164, 1, 0, 262167, 1, 0, 393208, 1, 0, 393209, 1, 0, 393211, 1, 0, 393212, 1, 0, 393213, 1, 0, 393214, 1, 0, 327680, 1, 0, 327681, 1, 0, 327682, 1, 0, 327683, 1, 0, 327684, 1, 0, 327685, 1, 0, 327686, 1, 0, 327687, 1, 0, 327688, 1, 0, 327689, 1, 0, 327690, 1, 0, 327692, 1, 0, 327693, 1, 0, 327696, 1, 0, 327697, 1, 0, 327698, 1, 0, 327699, 1, 0, 327701, 1, 0, 327702, 1, 0, 458743, 1, 0, 458744, 1, 0, 458745, 1, 0, 458746, 1, 0, 458748, 1, 0, 458749, 1, 0, 458750, 1, 0, 393216, 1, 0, 393217, 1, 0, 393218, 1, 0, 393219, 1, 0, 393220, 1, 0, 393221, 1, 0, 393222, 1, 0, 393223, 1, 0, 393224, 1, 0, 393225, 1, 0, 393226, 1, 0, 393227, 1, 0, 393228, 1, 0, 393229, 1, 0, 393232, 1, 0, 393233, 1, 0, 393234, 1, 0, 393236, 1, 0, 393237, 1, 0, 393238, 1, 0, 393239, 1, 0, 524279, 1, 0, 524280, 1, 0, 524281, 1, 0, 524282, 1, 0, 524283, 1, 0, 524285, 1, 0, 524286, 1, 0, 458752, 1, 0, 458753, 1, 0, 458754, 1, 0, 458755, 1, 0, 458756, 1, 0, 458757, 1, 0, 458758, 1, 0, 458759, 1, 0, 458760, 1, 0, 458761, 1, 0, 458762, 1, 0, 458763, 1, 0, 458764, 1, 0, 458765, 1, 0, 458766, 1, 0, 458768, 1, 0, 458769, 1, 0, 458771, 1, 0, 458772, 1, 0, 458773, 1, 0, 458774, 1, 0, 458775, 1, 0, 589815, 1, 0, 589816, 1, 0, 589817, 1, 0, 589818, 1, 0, 589819, 1, 0, 589820, 1, 0, 589822, 1, 0, 524304, 1, 0, 524306, 1, 0, 524307, 1, 0, 524308, 1, 0, 524309, 1, 0, 524310, 1, 0, 524311, 1, 0, 655351, 1, 0, 655352, 1, 0, 655353, 1, 0, 655354, 1, 0, 655355, 1, 0, 655356, 1, 0, 655357, 1, 0, 655359, 1, 0, 589824, 1, 0, 589825, 1, 0, 589826, 1, 0, 589827, 1, 0, 589828, 1, 0, 589829, 1, 0, 589830, 1, 0, 589832, 1, 0, 589833, 1, 0, 589834, 1, 0, 589835, 1, 0, 589836, 1, 0, 589837, 1, 0, 589838, 1, 0, 589839, 1, 0, 589841, 1, 0, 589842, 1, 0, 589843, 1, 0, 589844, 1, 0, 589845, 1, 0, 589846, 1, 0, 589847, 1, 0, 720887, 1, 0, 720888, 1, 0, 720889, 1, 0, 720890, 1, 0, 720891, 1, 0, 720892, 1, 0, 720894, 1, 0, 655360, 1, 0, 655361, 1, 0, 655362, 1, 0, 655363, 1, 0, 655364, 1, 0, 655365, 1, 0, 655366, 1, 0, 655368, 1, 0, 655369, 1, 0, 655370, 1, 0, 655371, 1, 0, 655372, 1, 0, 655373, 1, 0, 655374, 1, 0, 655376, 1, 0, 655378, 1, 0, 655379, 1, 0, 655380, 1, 0, 655381, 1, 0, 655382, 1, 0, 655383, 1, 0, 786423, 1, 0, 786424, 1, 0, 786425, 1, 0, 786426, 1, 0, 786427, 1, 0, 786429, 1, 0, 786430, 1, 0, 786431, 1, 0, 720897, 1, 0, 720898, 1, 0, 720899, 1, 0, 720900, 1, 0, 720901, 1, 0, 720902, 1, 0, 720904, 1, 0, 720905, 1, 0, 720906, 1, 0, 720907, 1, 0, 720908, 1, 0, 720909, 1, 0, 720911, 1, 0, 720912, 1, 0, 720913, 1, 0, 720915, 1, 0, 720916, 1, 0, 720917, 1, 0, 720918, 1, 0, 720919, 1, 0, 851959, 1, 0, 851960, 1, 0, 851961, 1, 0, 851962, 1, 0, 851964, 1, 0, 851965, 1, 0, 851966, 1, 0, 851967, 1, 0, 786432, 1, 0, 786434, 1, 0, 786435, 1, 0, 786436, 1, 0, 786437, 1, 0, 786438, 1, 0, 786440, 1, 0, 786441, 1, 0, 786442, 1, 0, 786443, 1, 0, 786444, 1, 0, 786446, 1, 0, 786447, 1, 0, 786448, 1, 0, 786449, 1, 0, 786450, 1, 0, 786452, 1, 0, 786453, 1, 0, 786454, 1, 0, 786455, 1, 0, 917495, 1, 0, 917496, 1, 0, 917497, 1, 0, 917499, 1, 0, 917500, 1, 0, 917501, 1, 0, 917502, 1, 0, 917503, 1, 0, 851968, 1, 0, 851969, 1, 0, 851971, 1, 0, 851972, 1, 0, 851973, 1, 0, 851974, 1, 0, 851976, 1, 0, 851977, 1, 0, 851978, 1, 0, 851979, 1, 0, 851981, 1, 0, 851982, 1, 0, 851983, 1, 0, 851984, 1, 0, 851985, 1, 0, 851986, 1, 0, 851987, 1, 0, 851989, 1, 0, 851990, 1, 0, 851991, 1, 0, 983031, 1, 0, 983032, 1, 0, 983034, 1, 0, 983035, 1, 0, 983036, 1, 0, 983037, 1, 0, 983038, 1, 0, 983039, 1, 0, 917504, 1, 0, 917505, 1, 0, 917506, 1, 0, 917508, 1, 0, 917509, 1, 0, 917510, 1, 0, 917512, 1, 0, 917513, 1, 0, 917514, 1, 0, 917516, 1, 0, 917517, 1, 0, 917518, 1, 0, 917519, 1, 0, 917520, 1, 0, 917521, 1, 0, 917522, 1, 0, 917523, 1, 0, 917524, 1, 0, 917526, 1, 0, 917527, 1, 0, 1048567, 1, 0, 1048569, 1, 0, 1048570, 1, 0, 1048571, 1, 0, 1048572, 1, 0, 1048573, 1, 0, 1048574, 1, 0, 1048575, 1, 0, 983040, 1, 0, 983041, 1, 0, 983042, 1, 0, 983043, 1, 0, 983045, 1, 0, 983047, 1, 0, 983049, 1, 0, 983051, 1, 0, 983052, 1, 0, 983053, 1, 0, 983054, 1, 0, 983055, 1, 0, 983056, 1, 0, 983057, 1, 0, 983058, 1, 0, 983059, 1, 0, 983060, 1, 0, 983061, 1, 0, 983063, 1, 0, 1114104, 1, 0, 1114105, 1, 0, 1114106, 1, 0, 1114107, 1, 0, 1114108, 1, 0, 1114109, 1, 0, 1114110, 1, 0, 1114111, 1, 0, 1048576, 1, 0, 1048577, 1, 0, 1048578, 1, 0, 1048579, 1, 0, 1048580, 1, 0, 1048582, 1, 0, 1048583, 1, 0, 1048584, 1, 0, 1048586, 1, 0, 1048587, 1, 0, 1048588, 1, 0, 1048589, 1, 0, 1048590, 1, 0, 1048591, 1, 0, 1048592, 1, 0, 1048593, 1, 0, 1048594, 1, 0, 1048595, 1, 0, 1048596, 1, 0, 1048597, 1, 0, 1048598, 1, 0 ) script = ExtResource( 3 ) -[node name="units" type="Node" parent="ground"] +[node name="LineManager" type="Node2D" parent="TileMap"] +script = ExtResource( 2 ) -[node name="Stack" parent="ground/units" instance=ExtResource( 4 )] -position = Vector2( 887.433, 714.205 ) -scale = Vector2( 4, 4 ) +[node name="Line3" type="Line2D" parent="TileMap/LineManager"] +z_index = 2 +default_color = Color( 1, 0.4, 0.4, 1 ) +joint_mode = 2 +begin_cap_mode = 2 +end_cap_mode = 2 -[node name="ressources" type="Node" parent="ground"] +[node name="Line2" type="Line2D" parent="TileMap/LineManager"] +z_index = 3 +default_color = Color( 0.952941, 1, 0.4, 1 ) +joint_mode = 2 +begin_cap_mode = 2 +end_cap_mode = 2 + +[node name="Line1" type="Line2D" parent="TileMap/LineManager"] +z_index = 4 +z_as_relative = false +joint_mode = 2 +begin_cap_mode = 2 +end_cap_mode = 2 + +[node name="Units" type="Node2D" parent="TileMap"] + +[node name="moveapcost" type="Label" parent="."] +margin_left = 458.0 +margin_top = 3.0 +margin_right = 498.0 +margin_bottom = 17.0 +custom_colors/font_color = Color( 0, 0, 0, 1 ) + +[node name="unitapcounter" type="Label" parent="."] +margin_left = 458.0 +margin_top = 26.0 +margin_right = 498.0 +margin_bottom = 40.0 +custom_colors/font_color = Color( 0, 0, 0, 1 ) [node name="Camera2D" type="Camera2D" parent="."] current = true @@ -114,9 +72,6 @@ script = ExtResource( 7 ) position = Vector2( 494.969, 425.958 ) scale = Vector2( 600, 600 ) -[node name="Item" parent="." instance=ExtResource( 13 )] -position = Vector2( 250, 530 ) - [node name="Container" type="Container" parent="."] margin_left = 1228.0 margin_top = -6.0 @@ -124,6 +79,7 @@ margin_right = 1914.0 margin_bottom = 1016.0 [node name="RegionUI" parent="Container" instance=ExtResource( 8 )] +visible = false [node name="TextureButton2" parent="Container/RegionUI" instance=ExtResource( 9 )] margin_left = 1321.32 diff --git a/Client/region/RegionTiles.tres b/Client/region/RegionTiles.tres new file mode 100644 index 0000000..b86cba0 --- /dev/null +++ b/Client/region/RegionTiles.tres @@ -0,0 +1,49 @@ +[gd_resource type="TileSet" load_steps=4 format=2] + +[ext_resource path="res://region/Unbenannt - Kopie - Kopie - Kopie - Kopie.png" type="Texture" id=1] +[ext_resource path="res://region/Unbenannt.png" type="Texture" id=2] +[ext_resource path="res://region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png" type="Texture" id=3] + +[resource] +0/name = "Unbenannt.png 0" +0/texture = ExtResource( 2 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 64, 64 ) +0/tile_mode = 0 +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shape_offset = Vector2( 0, 0 ) +0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +0/shape_one_way = false +0/shape_one_way_margin = 0.0 +0/shapes = [ ] +0/z_index = 0 +4/name = "Unbenannt - Kopie - Kopie - Kopie - Kopie.png 4" +4/texture = ExtResource( 1 ) +4/tex_offset = Vector2( 0, 0 ) +4/modulate = Color( 1, 1, 1, 1 ) +4/region = Rect2( 0, 0, 64, 64 ) +4/tile_mode = 0 +4/occluder_offset = Vector2( 0, 0 ) +4/navigation_offset = Vector2( 0, 0 ) +4/shape_offset = Vector2( 0, 0 ) +4/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +4/shape_one_way = false +4/shape_one_way_margin = 0.0 +4/shapes = [ ] +4/z_index = 0 +5/name = "Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png 5" +5/texture = ExtResource( 3 ) +5/tex_offset = Vector2( 0, 0 ) +5/modulate = Color( 1, 1, 1, 1 ) +5/region = Rect2( 0, 0, 64, 64 ) +5/tile_mode = 0 +5/occluder_offset = Vector2( 0, 0 ) +5/navigation_offset = Vector2( 0, 0 ) +5/shape_offset = Vector2( 0, 0 ) +5/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +5/shape_one_way = false +5/shape_one_way_margin = 0.0 +5/shapes = [ ] +5/z_index = 0 diff --git a/Client/region/SuperUnit.gd b/Client/region/SuperUnit.gd new file mode 100644 index 0000000..f9399b4 --- /dev/null +++ b/Client/region/SuperUnit.gd @@ -0,0 +1,75 @@ +extends Sprite + +signal positionReached +var Route +signal pathAnimationCompleted +signal unitSelected(unit) +var isSelected = false +var isMoving = false +var boardUnitsIndex +onready var region = get_parent().get_parent().get_parent() + +func on_ready():#this connects the unit to the main node using signals + connect("unitSelected",region, "unitSelectedMethod") + connect("pathAnimationCompleted",region, "_on_pathAnimationCompleted") + snapToPosition() + if region.boardUnits[boardUnitsIndex].faction == "enemyFaction": + modulate = Color(1,0,0,1) + if region.boardUnits[boardUnitsIndex].faction == "allyFaction": + modulate = Color(0,1,0,1) +# emit_signal("pathAnimationCompleted") + +func snapToPosition(): + self.position = get_parent().get_parent().map_to_world(region.boardUnits[boardUnitsIndex].coords) + var undertiles = [] + undertiles.append(Vector2(region.boardUnits[boardUnitsIndex].coords.x,region.boardUnits[boardUnitsIndex].coords.y)) + undertiles.append(Vector2(region.boardUnits[boardUnitsIndex].coords.x,region.boardUnits[boardUnitsIndex].coords.y+1)) + undertiles.append(Vector2(region.boardUnits[boardUnitsIndex].coords.x+1,region.boardUnits[boardUnitsIndex].coords.y)) + undertiles.append(Vector2(region.boardUnits[boardUnitsIndex].coords.x+1,region.boardUnits[boardUnitsIndex].coords.y+1)) +# unitCurrentUndertiles = undertiles + pass + +func _input(event):#this selects unit and signals the selected node to the main node + if event is InputEventMouseButton and Input.is_action_just_released("ui_right_mouse_button")and isMoving==false: + var localEvent = (self.make_input_local(event)) + if isSelected== true: + emit_signal("unitSelected",null) + isSelected = false + if localEvent.position.x > 0 and localEvent.position.y > 0 and localEvent.position.x < self.position.x + 128 and localEvent.position.y < self.position.y + 128: + print("superunit") + if isSelected== false: + emit_signal("unitSelected",self) + isSelected = true + return + +func moveOnPath(route:Array):#this coordinates the movement/animation + isMoving=true + var indexPosition = 0 + for coords in route: + if route[0] == coords: + var t = Transform2D() + t.origin = coords + else: + moveTo(route[indexPosition],coords) + yield(self,"positionReached") + indexPosition+=1 + emit_signal("pathAnimationCompleted") + isMoving = false + +var speed =4 +onready var motion = Vector2(0,0) + +func moveTo(start:Vector2, destination:Vector2):#this does a step of the movement/animation. coordinated by moveOnPath + var travel = destination-start + motion = travel*speed + yield(get_tree().create_timer(travel.length()/motion.length()), "timeout") + motion= Vector2(0,0) + var t = Transform2D() + t.origin = destination + transform = t + emit_signal("positionReached") +# unitCurrentPosition=GlobalTileMap.world_to_map(destination) + snapToPosition() + +func _physics_process(delta): + position += motion*delta diff --git a/Client/region/SuperUnit.tscn b/Client/region/SuperUnit.tscn new file mode 100644 index 0000000..1185eb4 --- /dev/null +++ b/Client/region/SuperUnit.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://region/SuperUnit.gd" type="Script" id=1] +[ext_resource path="res://icon.png" type="Texture" id=2] + +[node name="Sprite" type="Sprite"] +scale = Vector2( 2, 2 ) +z_index = 1 +z_as_relative = false +texture = ExtResource( 2 ) +centered = false +script = ExtResource( 1 ) diff --git a/Client/region/TileMap.gd b/Client/region/TileMap.gd new file mode 100644 index 0000000..7855189 --- /dev/null +++ b/Client/region/TileMap.gd @@ -0,0 +1,22 @@ +extends TileMap +var mountainTiles = [] +var roadTiles = [] + +func buildTileMap(tiles):#this builds the tilemap by looking up on the special tile arrays whether a tile belongs to a special category (road/mountain etc) if not the tile is grass + var x=0 + for column in tiles: + var y=0 + for tile in column: + if tile.type == "mountain": + set_cell(x,y,4) + elif tile.type == "road": + set_cell(x,y,5) + else: + set_cell(x, y, 0) + y += 1 + x += 1 + +func setTerrain():#this sets the special tile arrays to what is placed on the tilemap + roadTiles= get_used_cells_by_id(5) + mountainTiles = get_used_cells_by_id(4) + pass diff --git a/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png b/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png new file mode 100644 index 0000000000000000000000000000000000000000..0fade306a610bdc41c9f07b11a75693018c6449d GIT binary patch literal 4610 zcmeAS@N?(olHy`uVBq!ia0y~yU}<1rVCvvt1B!5HH}V20#^NA%Cx&(BWL^R}Ea{HE zjtmSN`?>!lvI6;>1s;*b3=DinK$vl=HlH*DgWz;e7srr_xVLu+xzd`zW00Wl6y8@KkUB%DBED9-vCs@@Q6hLNH$n7asVj> zKL#cs)gjyfBnLuj$LG>()ppP3RDbO;{8qK*>uXRTGZ^h5%USPg=6;>mZ}~iKerfFW zxcc(@-{a;R9=q{+yF#As+Bmk*<%F&Y}9<;G~?Fj{dy+DoJ5;b?g{S{{y;hoj}; qXn6=M2he)cqqW0`s~v6?{$U8@)&6Y$VF74dgu&C*&t;ucLK6T~3L)PB literal 0 HcmV?d00001 diff --git a/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png.import b/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png.import new file mode 100644 index 0000000..83f7c15 --- /dev/null +++ b/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://region/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png" +dest_files=[ "res://.import/Unbenannt - Kopie - Kopie - Kopie - Kopie - Kopie.png-25669cdb99469b4149cec015f84e52b1.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie.png b/Client/region/Unbenannt - Kopie - Kopie - Kopie - Kopie.png new file mode 100644 index 0000000000000000000000000000000000000000..83a8533bce23eb89c0e3e7ae8acbc38456e7eddd GIT binary patch literal 4549 zcmeAS@N?(olHy`uVBq!ia0y~yU}<1rVCvvt1B!5HH}V20#^NA%Cx&(BWL^R}Ea{HE zjtmSN`?>!lvI6;>1s;*b3=DinK$vl=HlH*DgJ6`Wi(^Pd+}k^bT!#$=7#uC-&Fg+1 zO>myIC&852DSUOz5!vjuJI`NB+g8s6G(+Ld=X*ek!G+TSL=`d#07-{A3@kuO;Cnge zm&$qXuN22#xBeT!1ai=npNwEBbp}Qt?+7+sqf*FWNKt6WexI3s=lYp%{=l$iXu%Wo zcMQ!Gn1O1R;86pOREiul8sDR-ADGNgi;2+`MYRk+n!iT#*J%D?5Ev~|MvD|+J{WCZ yLK@!lvI6;>1s;*b3=DinK$vl=HlH*DgJ8I)i(^Pd+}k^bT!#$=7#ubK|NngR zU?x-D!7R3xt5Hvj?!;xEt?e@_{v!-Df+2DKeQ_Ywpuxxiq!j!Zn1ED=a08HJcoa9? zVfu8X_kaIBt)J$=3=~OKgGjI_067g7*z}A_A%`F(p|PWOe&xF7vn>B{f&$w>*a1i} z6fy|_NryQMEI>*?oq-WZ9eKNvQ4&ZioMpix$>{);!me*r3ON)QdJLYf KelF{r5}E+rO!mP5 literal 0 HcmV?d00001 diff --git a/Client/region/Unbenannt - Kopie - Kopie - Kopie.png.import b/Client/region/Unbenannt - Kopie - Kopie - Kopie.png.import new file mode 100644 index 0000000..260bf93 --- /dev/null +++ b/Client/region/Unbenannt - Kopie - Kopie - Kopie.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://region/Unbenannt - Kopie - Kopie - Kopie.png" +dest_files=[ "res://.import/Unbenannt - Kopie - Kopie - Kopie.png-87c11b1469a9d84d4f76a51d1203572a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Client/region/Unbenannt - Kopie - Kopie.png b/Client/region/Unbenannt - Kopie - Kopie.png new file mode 100644 index 0000000000000000000000000000000000000000..6b9a5e7ea639a17237533706ee15319320672491 GIT binary patch literal 4555 zcmeAS@N?(olHy`uVBq!ia0y~yU}<1rVCvvt1B!5HH}V20#^NA%Cx&(BWL^R}Ea{HE zjtmSN`?>!lvI6;>1s;*b3=DinK$vl=HlH*DgJ6QEi(^Pd+}k@Fd7B+XSRD&Ek60Z3 zEAHaa6McZsujmoiw3$!hcvr8VeZF+}vf0snwK_nP8s;6ZU_I8aR$DN8{0I5F0=>Q}d3Yi3eq{AEr79b^{J}O1!(D=MF z@A{4HTV;Mn01ala)oTDzs8Qs{zyuWQn7w}eMo`3X6fus*1uz^&Q|4%91SW&gqG`0C z9xV??%fr#e$!LW*S|N^Bh@(B1(H7BYi)ge(M0$&8iSK3hntS4ZuWu8{0_tY)boFyt I=akR{02`z7I{*Lx literal 0 HcmV?d00001 diff --git a/Client/region/Unbenannt - Kopie - Kopie.png.import b/Client/region/Unbenannt - Kopie - Kopie.png.import new file mode 100644 index 0000000..8b9af77 --- /dev/null +++ b/Client/region/Unbenannt - Kopie - Kopie.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://region/Unbenannt - Kopie - Kopie.png" +dest_files=[ "res://.import/Unbenannt - Kopie - Kopie.png-efca2ee418235964b71d2c06816282db.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Client/region/Unbenannt - Kopie.png b/Client/region/Unbenannt - Kopie.png new file mode 100644 index 0000000000000000000000000000000000000000..e1b1978efd850202c77a8fa5c9ef1d79dff90cdd GIT binary patch literal 4551 zcmeAS@N?(olHy`uVBq!ia0y~yU}<1rVCvvt1B!5HH}V20#^NA%Cx&(BWL^R}Ea{HE zjtmSN`?>!lvI6;>1s;*b3=DjSK$uZf!>fUTK`_SC#WAEJ?(Lm}yoU@#SRH4p1;x(d zKHI9r!|olkB4OsvA6Ga0`XqCG@3HyO&o_z#jd3`iydOw0xNtgvs6r+IAn7oNfdxnj zeE%%`;?wdIpMTzZeOmnjNMa_p0+4F3VB`Q&3VsYsK&nHy0Z1}DVo?B+qf*ohjl90s zan=9VmdaH#0z>x84&0%gx2}ILNDW63BRJyJ89=-v*y40l3OR+3hQ?@UjOG-0fj^oZ zMzh0cb{NeLqb&zW19-GN94!w=%fr#~aI`!e;pO3y-j8e^vEqOAS1MZo3j_vFS3j3^ HP6!lvI6;>1s;*b3=DjSL74G){)!YJL&4L4i8Rg{oi%}`4>r`eszHaASuYm#=syTh+sxC=h(e}d&HiZfq}z-fuW&; z0m$kYW#S8mHH>AC&IAKP^PAcMAgRQ}!@!`RgkTn(=D#v~>sKyBP<;JLe0(MgvJYD@< J);T3K0RUbK1C#&& literal 0 HcmV?d00001 diff --git a/Client/region/Unbenannt.png.import b/Client/region/Unbenannt.png.import new file mode 100644 index 0000000..111f02b --- /dev/null +++ b/Client/region/Unbenannt.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Unbenannt.png-33f6792a5bb8046827aa692c8732e313.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://region/Unbenannt.png" +dest_files=[ "res://.import/Unbenannt.png-33f6792a5bb8046827aa692c8732e313.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/Client/region/Unit.gd b/Client/region/Unit.gd new file mode 100644 index 0000000..822a228 --- /dev/null +++ b/Client/region/Unit.gd @@ -0,0 +1,64 @@ +extends Sprite + +signal positionReached +var Route +signal pathAnimationCompleted +signal unitSelected(unit) +var isSelected = false +var isMoving = false +var boardUnitsIndex +onready var region = get_parent().get_parent().get_parent() + +func on_ready():#this connects the unit to the main node using signals + connect("unitSelected",region, "unitSelectedMethod") + connect("pathAnimationCompleted",region, "_on_pathAnimationCompleted") + snapToPosition() + if region.boardUnits[boardUnitsIndex].faction == "enemyFaction": + modulate = Color(1,0,0,1) + if region.boardUnits[boardUnitsIndex].faction == "allyFaction": + modulate = Color(0,1,0,1) +# emit_signal("pathAnimationCompleted") + +func snapToPosition(): + self.position = get_parent().get_parent().map_to_world(region.boardUnits[boardUnitsIndex].coords) + +func _input(event):#this selects unit and signals the selected node to the main node + if event is InputEventMouseButton and Input.is_action_just_released("ui_right_mouse_button")and isMoving==false: + var localEvent = (self.make_input_local(event)) + if isSelected== true: + emit_signal("unitSelected",null) + isSelected = false + elif event.position.x > 0 and localEvent.position.y > 0 and localEvent.position.x < self.position.x + 64 and localEvent.position.y < self.position.y + 64: + emit_signal("unitSelected",self) + isSelected = true + return + +func moveOnPath(route:Array):#this coordinates the movement/animation + isMoving=true + var indexPosition = 0 + for coords in route: + if route[0] == coords: + var t = Transform2D() + t.origin = coords + else: + moveTo(route[indexPosition],coords) + yield(self,"positionReached") + indexPosition+=1 + emit_signal("pathAnimationCompleted") + isMoving = false + snapToPosition() + +var speed =4 +onready var motion = Vector2(0,0) + +func moveTo(start:Vector2, destination:Vector2):#this does a step of the movement/animation. coordinated by moveOnPath + var travel = destination-start + motion = travel*speed + yield(get_tree().create_timer(travel.length()/motion.length()), "timeout") + motion= Vector2(0,0) + position = destination + emit_signal("positionReached") + +func _physics_process(delta): +# print(position) + position += motion*delta diff --git a/Client/region/Unit.tscn b/Client/region/Unit.tscn new file mode 100644 index 0000000..ee3c992 --- /dev/null +++ b/Client/region/Unit.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://region/Unit.gd" type="Script" id=1] +[ext_resource path="res://icon.png" type="Texture" id=2] + +[node name="Unit" type="Sprite"] +z_index = 1 +z_as_relative = false +texture = ExtResource( 2 ) +centered = false +script = ExtResource( 1 ) diff --git a/Server/autoloads/Network.gd b/Server/autoloads/Network.gd index 146e5f3..1ea277e 100644 --- a/Server/autoloads/Network.gd +++ b/Server/autoloads/Network.gd @@ -16,6 +16,10 @@ signal server_disconnected func _ready(): get_tree().connect('network_peer_disconnected', self, '_on_player_disconnected') get_tree().connect('network_peer_connected', self, '_on_player_connected') + create_server() + +remote func TESTFUNCTION(string): + print(string) remote func checkServerPassword(serverPassword): if (serverPassword=="myPW"): @@ -54,8 +58,9 @@ func firstStart(): # file.close() func _on_player_disconnected(id): - players.erase(id) - PlayerManager.player_disconnected(id) + pass +# players.erase(id) +# PlayerManager.player_disconnected(id) func _on_player_connected(connected_player_id): print(">>>>>>>>>>> on player connected <<<<<<<<<<<<< ", connected_player_id) diff --git a/Server/autoloads/PlayerManager.gd b/Server/autoloads/PlayerManager.gd index 840c6fb..52a244a 100644 --- a/Server/autoloads/PlayerManager.gd +++ b/Server/autoloads/PlayerManager.gd @@ -129,8 +129,9 @@ func identifyPlayer(playerName, pw = ''): # get the data from the json file func player_disconnected(id): - if clients_factions[id]: - clients_factions.erase(id) + pass +# if clients_factions[id]: +# clients_factions.erase(id) remote func receiveAuth(response): diff --git a/Server/autoloads/WorldManager.gd b/Server/autoloads/WorldManager.gd index f9d06fe..ec31738 100644 --- a/Server/autoloads/WorldManager.gd +++ b/Server/autoloads/WorldManager.gd @@ -201,12 +201,18 @@ remote func settle(tile, army, ascending): #if ascending, the cheapest ressource var finish = buildingtime + ['turn'] var regions = {} + func _ready(): - var newRegion = load("res://region/Region.gd") - regions["123"] = newRegion + var newRegion = load("res://region/Region.gd").new() + newRegion.buildWorld() + regions[123] = newRegion -func requestTiles(unit,regionId = 123): - rpc_id(1, 'requestTiles',regions["123"].requestTiles()) +remote func requestTiles(unit,regionId = 123): + var clientId = get_tree().get_rpc_sender_id() + var tileStuff = regions[regionId].requestTiles(unit) + rpc_id(clientId, 'receiveTiles', tileStuff) -func requestUnits(regionId = 123): - rpc_id(1, 'requestUnits', regions["123"].requestUnits()) +remote func requestUnits(regionId = 123): + var clientId = get_tree().get_rpc_sender_id() + var boardUnits = regions[regionId].requestUnits() + rpc_id(clientId, 'receiveUnits', boardUnits) diff --git a/Server/menues/Main Menue.tscn b/Server/menues/Main Menue.tscn index d35f5ab..4e14f84 100644 --- a/Server/menues/Main Menue.tscn +++ b/Server/menues/Main Menue.tscn @@ -26,9 +26,6 @@ margin_top = -2.96259 margin_right = 1919.0 margin_bottom = 1021.04 alignment = 1 -__meta__ = { -"_edit_use_anchors_": false -} [node name="Label" type="Label" parent="VBoxContainer"] margin_top = 203.0 diff --git a/Server/region/Region.gd b/Server/region/Region.gd index efb9029..46fb87d 100644 --- a/Server/region/Region.gd +++ b/Server/region/Region.gd @@ -337,10 +337,10 @@ func addEnemyOccupiedTilesToMap(enemyOccupiedTiles):#this creates the tiles arra return mapTiles -func requestTiles(unit, clientID): +func requestTiles(unit): var newTiles = setVertices(addEnemyOccupiedTilesToMap(getOccupiedTiles(unit)[1])) var newSuperTiles = buildSuperTiles(setVertices(addEnemyOccupiedTilesToMap(getOccupiedTiles(unit)[1]))) return [tileRect, newTiles, newSuperTiles] -func requestUnits(clientID): +func requestUnits(): return boardUnits