Skip to content

Commit

Permalink
kik
Browse files Browse the repository at this point in the history
  • Loading branch information
ra314 committed Aug 16, 2021
1 parent 558cede commit e44f6e7
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="b42e885189849586aa57216be39b19b7"
dest_md5="b9769c316c5457a0dfea2d7b48f6ad31"
source_md5="2473f3d75b41049b1cb0e3c635d00c5e"
dest_md5="9f9e9e243d8d7a25e19238cc32c77415"

Binary file modified .import/Crucible Mask.png-9ddb903f7364de6a0624c3928ca7e3ee.stex
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source_md5="c34cc86cff8ee85050f0a15eb96b822f"
dest_md5="122666a3a6313470dfc409324703c420"
source_md5="8510d136bcd95fd71040d93f1ff5f10b"
dest_md5="829b8e54b6ea88097f74215b72d02cbc"

Binary file modified .import/No Mans Land Mask.png-eabc9e47ab216c27ce222022d80af92a.stex
Binary file not shown.
Binary file modified Assets/Crucible Mask.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 modified Assets/No Mans Land Mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 21 additions & 21 deletions Crucible.save
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{"connections":[20,35,10],"name":15,"troops":1,"x":668,"y":327}
{"connections":[20,90,15,25],"name":10,"troops":2,"x":796,"y":216}
{"connections":[10,25,30,15],"name":20,"troops":3,"x":810,"y":317}
{"connections":[20,105,30,10],"name":25,"troops":3,"x":932,"y":314}
{"connections":[20,105,25],"name":30,"troops":2,"x":807,"y":411}
{"connections":[90,100,85],"name":95,"troops":1,"x":1067,"y":306}
{"connections":[10,95,85],"name":90,"troops":1,"x":1117,"y":215}
{"connections":[95,85,105],"name":100,"troops":1,"x":1131,"y":364}
{"connections":[100,90,80,66,95],"name":85,"troops":1,"x":1302,"y":342}
{"connections":[100,25,30,35,55,65,66],"name":105,"troops":1,"x":1007,"y":482}
{"connections":[85,80,65,105],"name":66,"troops":2,"x":1151,"y":559}
{"connections":[85,66,70,75],"name":80,"troops":1,"x":1239,"y":711}
{"connections":[66,55,105,60],"name":65,"troops":1,"x":1014,"y":659}
{"connections":[35,50,65,105],"name":55,"troops":2,"x":853,"y":606}
{"connections":[40,15,55,105,50],"name":35,"troops":1,"x":635,"y":493}
{"connections":[35,45,50],"name":40,"troops":1,"x":600,"y":580}
{"connections":[50,40],"name":45,"troops":1,"x":612,"y":697}
{"connections":[60,45,40,55,35],"name":50,"troops":1,"x":730,"y":785}
{"connections":[70,50,65,75],"name":60,"troops":3,"x":876,"y":790}
{"connections":[80,75,60],"name":70,"troops":2,"x":947,"y":838}
{"connections":[80,70,60],"name":75,"troops":2,"x":1053,"y":946}
{"connections":[90,20,25,15],"name":10,"troops":4,"x":813.794006,"y":204.588013}
{"connections":[10,20,35],"name":15,"troops":2,"x":674.794006,"y":336.588013}
{"connections":[10,15,25,30],"name":20,"troops":2,"x":809.794006,"y":315.588013}
{"connections":[105,10,20,30],"name":25,"troops":1,"x":914.794006,"y":322.588013}
{"connections":[105,20,25],"name":30,"troops":1,"x":818.794006,"y":406.588013}
{"connections":[105,15,40,50,55],"name":35,"troops":2,"x":693.794006,"y":536.588013}
{"connections":[35,45,50],"name":40,"troops":2,"x":641.794006,"y":600.588013}
{"connections":[40,50],"name":45,"troops":1,"x":610.794006,"y":710.588013}
{"connections":[45,40,55,35,60],"name":50,"troops":1,"x":739.794006,"y":780.588013}
{"connections":[105,50,65,35],"name":55,"troops":1,"x":845.794006,"y":606.588013}
{"connections":[50,70,75,65],"name":60,"troops":1,"x":876.794006,"y":846.588013}
{"connections":[105,60,110,55],"name":65,"troops":2,"x":1001.794006,"y":652.588013}
{"connections":[60,75,80],"name":70,"troops":1,"x":959.794006,"y":832.588013}
{"connections":[70,60,80],"name":75,"troops":3,"x":1043.793945,"y":938.588013}
{"connections":[70,75,110,85],"name":80,"troops":1,"x":1216.793945,"y":752.588013}
{"connections":[90,95,100,110,80],"name":85,"troops":3,"x":1318.793945,"y":419.588013}
{"connections":[95,10,85],"name":90,"troops":1,"x":1102.793945,"y":225.588013}
{"connections":[90,85,100],"name":95,"troops":1,"x":1075.793945,"y":306.588013}
{"connections":[95,105,85],"name":100,"troops":1,"x":1122.793945,"y":381.588013}
{"connections":[100,25,30,35,55,65,110],"name":105,"troops":2,"x":1007.794006,"y":476.588013}
{"connections":[105,65,80,85],"name":110,"troops":1,"x":1142.793945,"y":575.588013}
70 changes: 35 additions & 35 deletions No Mans Land.save
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
{"connections":[125,20,10,125],"name":15,"troops":2,"x":401.794006,"y":338.588013}
{"connections":[165,15],"name":10,"troops":4,"x":558.794006,"y":199.588013}
{"connections":[165,170],"name":175,"troops":1,"x":597.794006,"y":369.588013}
{"connections":[10,160,170,175],"name":165,"troops":1,"x":660.794006,"y":288.588013}
{"connections":[165,175],"name":170,"troops":2,"x":691.794006,"y":356.588013}
{"connections":[165,155],"name":160,"troops":2,"x":835.794006,"y":280.588013}
{"connections":[160,145,150],"name":155,"troops":1,"x":877.794006,"y":381.588013}
{"connections":[155,150,140],"name":145,"troops":2,"x":945.794006,"y":353.588013}
{"connections":[145,155],"name":150,"troops":2,"x":972.794006,"y":453.588013}
{"connections":[145,135,130],"name":140,"troops":2,"x":1151.793945,"y":269.588013}
{"connections":[140,95],"name":135,"troops":2,"x":1189.793945,"y":413.588013}
{"connections":[140,120],"name":130,"troops":2,"x":1299.793945,"y":225.588013}
{"connections":[130,125,115,110],"name":120,"troops":2,"x":1408.793945,"y":279.588013}
{"connections":[120,15,15],"name":125,"troops":2,"x":1532.793945,"y":203.588013}
{"connections":[120,110],"name":115,"troops":2,"x":1481.793945,"y":314.588013}
{"connections":[120,115,95,20],"name":110,"troops":1,"x":1480.793945,"y":415.588013}
{"connections":[110,135,100,85],"name":95,"troops":1,"x":1334.793945,"y":544.588013}
{"connections":[95,105],"name":100,"troops":4,"x":1425.793945,"y":603.588013}
{"connections":[100,25],"name":105,"troops":2,"x":1477.793945,"y":675.588013}
{"connections":[95,90,75],"name":85,"troops":1,"x":1221.793945,"y":691.588013}
{"connections":[85],"name":90,"troops":2,"x":1236.793945,"y":790.588013}
{"connections":[85,80,70,65],"name":75,"troops":1,"x":991.794006,"y":703.588013}
{"connections":[75,65],"name":70,"troops":3,"x":920.794006,"y":714.588013}
{"connections":[75,70,60,50],"name":65,"troops":1,"x":849.794006,"y":769.588013}
{"connections":[75],"name":80,"troops":3,"x":1031.793945,"y":785.588013}
{"connections":[65,55],"name":60,"troops":4,"x":811.794006,"y":888.588013}
{"connections":[60,40],"name":55,"troops":3,"x":716.794006,"y":921.588013}
{"connections":[55,45,35],"name":40,"troops":1,"x":554.794006,"y":893.588013}
{"connections":[45,65,45],"name":50,"troops":2,"x":651.794006,"y":677.588013}
{"connections":[45,50,30],"name":45,"troops":1,"x":558.794006,"y":708.588013}
{"connections":[45,35,25],"name":30,"troops":1,"x":398.794006,"y":757.588013}
{"connections":[30,40,25],"name":35,"troops":4,"x":347.794006,"y":875.588013}
{"connections":[30,35,20,105],"name":25,"troops":1,"x":323.794006,"y":726.588013}
{"connections":[25,15,110],"name":20,"troops":2,"x":318.794006,"y":502.588013}
{"connections":[40,45,50],"name":45,"troops":2,"x":601.794006,"y":754.588013}
{"connections":[165,15],"name":10,"troops":1,"x":564,"y":198}
{"connections":[10,20,125],"name":15,"troops":2,"x":399.794006,"y":351.588013}
{"connections":[25,15,110],"name":20,"troops":2,"x":322.794006,"y":511.588013}
{"connections":[30,35,20,105],"name":25,"troops":1,"x":308.794006,"y":716.588013}
{"connections":[45,25,35],"name":30,"troops":1,"x":416.794006,"y":753.588013}
{"connections":[30,25,40],"name":35,"troops":1,"x":358.794006,"y":887.588013}
{"connections":[55,180,35],"name":40,"troops":1,"x":545.794006,"y":885.588013}
{"connections":[180,50,30],"name":45,"troops":3,"x":559.794006,"y":702.588013}
{"connections":[45,65,180],"name":50,"troops":1,"x":650.794006,"y":662.588013}
{"connections":[60,40],"name":55,"troops":1,"x":714.794006,"y":919.588013}
{"connections":[65,55],"name":60,"troops":1,"x":810.794006,"y":888.588013}
{"connections":[70,75,60,50],"name":65,"troops":1,"x":861.794006,"y":762.588013}
{"connections":[75,65],"name":70,"troops":4,"x":922.794006,"y":709.588013}
{"connections":[85,70,65,80],"name":75,"troops":2,"x":1006.794006,"y":700.588013}
{"connections":[75],"name":80,"troops":1,"x":1023.794006,"y":798.588013}
{"connections":[95,90,75],"name":85,"troops":1,"x":1220.793945,"y":684.588013}
{"connections":[85],"name":90,"troops":2,"x":1229.793945,"y":802.588013}
{"connections":[110,135,100,85],"name":95,"troops":2,"x":1322.793945,"y":535.588013}
{"connections":[95,105],"name":100,"troops":1,"x":1415.793945,"y":605.588013}
{"connections":[100,25],"name":105,"troops":2,"x":1474.793945,"y":679.588013}
{"connections":[120,115,95,20],"name":110,"troops":2,"x":1463.793945,"y":417.588013}
{"connections":[120,110],"name":115,"troops":4,"x":1468.793945,"y":315.588013}
{"connections":[130,125,115,110],"name":120,"troops":1,"x":1404.793945,"y":283.588013}
{"connections":[120,15],"name":125,"troops":4,"x":1529.793945,"y":204.588013}
{"connections":[140,120],"name":130,"troops":2,"x":1295.793945,"y":226.588013}
{"connections":[140,95],"name":135,"troops":4,"x":1182.793945,"y":417.588013}
{"connections":[145,130,135],"name":140,"troops":2,"x":1154.793945,"y":270.588013}
{"connections":[155,150,140],"name":145,"troops":2,"x":949.794006,"y":349.588013}
{"connections":[145,155],"name":150,"troops":2,"x":961.794006,"y":445.588013}
{"connections":[160,145,150],"name":155,"troops":2,"x":887.794006,"y":385.588013}
{"connections":[165,155],"name":160,"troops":1,"x":835.794006,"y":277.588013}
{"connections":[10,170,175,160],"name":165,"troops":1,"x":660.794006,"y":287.588013}
{"connections":[165,175],"name":170,"troops":3,"x":689.794006,"y":378.588013}
{"connections":[165,170],"name":175,"troops":2,"x":593.794006,"y":369.588013}
{"connections":[40,45,50],"name":180,"troops":1,"x":590.794006,"y":766.588013}
20 changes: 8 additions & 12 deletions Scripts/Level_Funcs.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,16 @@ func export_level(save_name):
var save_game = File.new()
save_game.open("res://" + save_name + ".save", File.WRITE)
# Converting each country to a json and dumping them all
for country in all_countries.values():
var arr = all_countries.values()
arr.sort_custom(self, "country_comparator")
print(all_countries)
for country in arr:
save_game.store_line(to_json(country.save()))
save_game.close()

func country_comparator(c1, c2):
return c1.country_name < c2.country_name

func select_random(array):
var rng = RandomNumberGenerator.new()
rng.randomize()
Expand Down Expand Up @@ -118,14 +124,4 @@ func add_connections(source_country_name, destination_country_names):
func get_color_in_mask():
return world_mask.get_pixel(get_local_mouse_position()[0]*2, get_local_mouse_position()[1]*2)*255

#func _input(event):
# if event.is_pressed():
# if not (Rect2(Vector2(0,0), world_mask.get_size()).has_point(get_local_mouse_position())):
# return
#
# # Print color of pixel under mouse cursos when clicked
# print(get_color_in_mask())
#
# var country_name = get_color_in_mask()[0]
# if country_name in all_countries:
# all_countries[country_name].on_click(event)

5 changes: 3 additions & 2 deletions Scripts/Levels/Level Components/Country.gd
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ func can_attack():
return false

func _input_event(viewport, event, shape_idx):
if event.is_pressed():
self.on_click(event)
if get_tree().get_current_scene().get_name() == "Level Creator":
if event.is_pressed():
self.on_click(event)

func on_click(event):
# Level Creator Behaviour
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Levels/Level Creator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var add_countries_button = null
var export_level_button = null
var connect_countries_button = null
var information_label = null
var _world_str = "No Mans Land"
var _world_str = "Crucible"

# Called when the node enters the scene tree for the first time.
func _ready():
Expand Down
10 changes: 10 additions & 0 deletions Scripts/Levels/Level Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,17 @@ remote func synchronise_players_and_round(_curr_player_index, _round_number, pla
curr_player = players.values()[curr_player_index]
update_labels()

func _input(event):
if event.is_pressed():
if not (Rect2(Vector2(0,0), world_mask.get_size()).has_point(get_local_mouse_position())):
return

# Print color of pixel under mouse cursos when clicked
print(get_color_in_mask())

var country_name = get_color_in_mask()[0]
if country_name in all_countries:
all_countries[country_name].on_click(event)

var time_since_sync = 0
func _process(delta):
Expand Down

0 comments on commit e44f6e7

Please sign in to comment.