Skip to content

Commit

Permalink
add 2 world 2 player split screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ole1711 committed Jan 21, 2024
1 parent c6668b2 commit 5cd951d
Show file tree
Hide file tree
Showing 17 changed files with 1,829 additions and 1,629 deletions.
18 changes: 18 additions & 0 deletions Tilemap.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://4j52c4ucysq5"]

[ext_resource type="Script" path="res://addons/pronto/helpers/Behavior.gd" id="2_ei3uw"]

[sub_resource type="TileSet" id="TileSet_ior3y"]
physics_layer_0/collision_layer = 1

[node name="TileMap" type="TileMap"]
position = Vector2(-1, -1)
tile_set = SubResource("TileSet_ior3y")
format = 2
layer_0/tile_data = PackedInt32Array(1966089, 0, 0, 1966090, 65536, 0, 1966091, 65536, 0, 1966092, 65536, 0, 1966093, 65536, 0, 1966094, 65536, 0, 1966095, 65536, 0, 1966096, 65536, 0, 1966097, 65536, 0, 1966098, 65536, 0, 1966099, 65536, 0, 1966100, 65536, 0, 1966101, 65536, 0, 1966102, 65536, 0, 1966103, 65536, 0, 1966104, 65536, 0, 1966105, 65536, 0, 1966106, 65536, 0, 1966107, 65536, 0, 1966108, 65536, 0, 1966109, 65536, 0, 1966110, 131072, 0, 2031646, 131072, 1, 2097182, 131072, 1, 2162718, 131072, 1, 2031625, 0, 1, 2097161, 0, 1, 2162697, 0, 1, 2031626, 65536, 1, 2031627, 65536, 1, 2097164, 65536, 1, 2097165, 65536, 1, 2097166, 65536, 1, 2097167, 65536, 1, 2097168, 65536, 1, 2162705, 65536, 1, 2162706, 65536, 1, 2162707, 65536, 1, 2162708, 65536, 1, 2162709, 65536, 1, 2162710, 65536, 1, 2162711, 65536, 1, 2162712, 65536, 1, 2162713, 65536, 1, 2162714, 65536, 1, 2162715, 65536, 1, 2162716, 65536, 1, 2162717, 65536, 1, 2097181, 65536, 1, 2031645, 65536, 1, 2031644, 65536, 1, 2031643, 65536, 1, 2031642, 65536, 1, 2031641, 65536, 1, 2031640, 65536, 1, 2031639, 65536, 1, 2031638, 65536, 1, 2031637, 65536, 1, 2031636, 65536, 1, 2031635, 65536, 1, 2097170, 65536, 1, 2097169, 65536, 1, 2097163, 65536, 1, 2031629, 65536, 1, 2031628, 65536, 1, 2031630, 65536, 1, 2031631, 65536, 1, 2031632, 65536, 1, 2031633, 65536, 1, 2031634, 65536, 1, 2097171, 65536, 1, 2097172, 65536, 1, 2097173, 65536, 1, 2097174, 65536, 1, 2097175, 65536, 1, 2097176, 65536, 1, 2097177, 65536, 1, 2097178, 65536, 1, 2097179, 65536, 1, 2097180, 65536, 1, 2162704, 65536, 1, 2162703, 65536, 1, 2097162, 65536, 1, 2162698, 65536, 1, 2162699, 65536, 1, 2162701, 65536, 1, 2162702, 65536, 1, 2162700, 65536, 1)

[node name="_Node2D_56092" type="Node2D" parent="."]
script = ExtResource("2_ei3uw")

[node name="_Node2D_50717" type="Node2D" parent="."]
script = ExtResource("2_ei3uw")
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ extends Node2D
"2": {
viewport = $RightSubViewportContainer/SubViewport,
camera = $RightSubViewportContainer/SubViewport/Camera2D,
player = $LeftSubViewportContainer/SubViewport/Level/Player2,
player = $RightSubViewportContainer/SubViewport/Level2/Player2,
}
}

# Called when the node enters the scene tree for the first time.
func _ready():
players["2"].viewport.world_2d = players["1"].viewport.world_2d

for node in players.values():
var remote_transform := RemoteTransform2D.new()
remote_transform.remote_path = node.camera.get_path()
print(node)
node.player.add_child(remote_transform)

# Called every frame. 'delta' is the elapsed time since the previous frame.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://c83unhh8aqtco"]
[gd_scene load_steps=5 format=3 uid="uid://c83unhh8aqtco"]

[ext_resource type="Script" path="res://addons/pronto/behaviors/ExportBehavior.gd" id="1"]
[ext_resource type="Script" path="res://prototypes/game-shadows-of-surveillance/game-shadows-of-surveillance.gd" id="1_odj0a"]
[ext_resource type="PackedScene" uid="uid://dyvtu758xr2so" path="res://scenes/level.tscn" id="3_3xcs3"]
[ext_resource type="PackedScene" uid="uid://bpgsybybj4jmh" path="res://scenes/level2.tscn" id="4_l12nx"]

[node name="Game" type="Node2D"]
script = ExtResource("1_odj0a")
Expand Down Expand Up @@ -42,6 +43,8 @@ render_target_update_mode = 4

[node name="Camera2D" type="Camera2D" parent="RightSubViewportContainer/SubViewport"]

[node name="Level2" parent="RightSubViewportContainer/SubViewport" instance=ExtResource("4_l12nx")]

[node name="ColorRect" type="ColorRect" parent="."]
offset_left = 566.0
offset_top = -4.0
Expand Down
2 changes: 1 addition & 1 deletion prototypes/game-shadows-of-surveillance/game_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"Matvey Sivashinski"
],
"description": "You are a brilliant scientist who just discovered time travel. Unfortunately, during your first test, something goes wrong and your mind is split into two parts, one part travels to the future and one is stuck in the present. \nIn this coop split screen game, your goal is to somehow recombine the two parts of your mind. But be careful: In the future, some things have changed...",
"time": "2024-01-20",
"time": "2024-01-21",
"title": "Shadows of Surveillance"
}
Binary file modified prototypes/game-shadows-of-surveillance/thumbnail.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 scenes/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions scenes/6.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://ej3g6agmjf0x"
path="res://.godot/imported/6.png-c06dffe52f4b8d6980da99e3e1977693.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://scenes/6.png"
dest_files=["res://.godot/imported/6.png-c06dffe52f4b8d6980da99e3e1977693.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions scenes/character.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ shape = SubResource("RectangleShape2D_6dg28")
[node name="PlatformerControllerBehavior" type="Node2D" parent="."]
position = Vector2(576, 324)
script = ExtResource("2_uxt7j")
player = null
Binary file added scenes/david_player1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions scenes/david_player1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b6etujec8ohme"
path="res://.godot/imported/david_player1.png-598717f91a06f9a7a46ac286cb4c4d33.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://scenes/david_player1.png"
dest_files=["res://.godot/imported/david_player1.png-598717f91a06f9a7a46ac286cb4c4d33.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading

0 comments on commit 5cd951d

Please sign in to comment.