commit 4ad85497c982953a0af68c4bd60cea67acea925b Author: James Date: Sun Dec 3 15:49:59 2023 +0000 initial alpha7 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ecbb5c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Godot 4+ specific ignores +.godot/ +bin/ diff --git a/Body2D.gd b/Body2D.gd new file mode 100644 index 0000000..6fb8a9d --- /dev/null +++ b/Body2D.gd @@ -0,0 +1,32 @@ +extends RigidBody2D + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _integrate_forces(state: PhysicsDirectBodyState2D): + var contact_count = state.get_contact_count() + #print("aa") + for i in range(contact_count): + #print("bb") + var collider_object = state.get_contact_collider_object(i) + if collider_object and collider_object.get_parent() is Player: + handle_player_collision(collider_object.get_parent()) + if collider_object and collider_object.get_parent() is Pool: + handle_pool_collision(collider_object.get_parent()) + +func handle_player_collision(player: Player): + if $"..".is_carrying() and player.is_carrying(): + $"..".doubledrop(player) + $"..".drop() + player.drop() + + +func handle_pool_collision(pool: Pool): + $"..".exchange_with(pool) diff --git a/Button.gd b/Button.gd new file mode 100644 index 0000000..e79627f --- /dev/null +++ b/Button.gd @@ -0,0 +1,17 @@ +extends Button + +@export_file var map_path + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _on_pressed(): + if map_path==null: + return + + var sim = load("res://sim.tscn").instantiate() + var map = load(map_path).instantiate() + sim.add_child(map) + get_tree().root.add_child(sim) + get_node("/root/MapSelect").queue_free() diff --git a/Debug.gd b/Debug.gd new file mode 100644 index 0000000..d64bcca --- /dev/null +++ b/Debug.gd @@ -0,0 +1,16 @@ +extends Label + +var elapsed_time = 0.0 # Initialize a variable to keep track of elapsed time + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + +func _process(delta): + elapsed_time += delta # Increment the elapsed time by the frame's delta time + var hours = int(elapsed_time / 3600) + var minutes = int(elapsed_time / 60) % 60 + var seconds = int(elapsed_time) % 60 + var time_string = "%02d:%02d:%02d" % [hours, minutes, seconds] # Format time as H:M:S + var fps = Engine.get_frames_per_second() # Get the current FPS + text = time_string+" "+str(fps) + " fps" # Combine FPS and runtime into one string diff --git a/Pool.gd b/Pool.gd new file mode 100644 index 0000000..b2213f8 --- /dev/null +++ b/Pool.gd @@ -0,0 +1,56 @@ +@tool +class_name Pool +extends Node2D + +@export var mana_r: int = 10 +@export var mana_g: int = 10 +@export var mana_b: int = 10 + +# Called when the node enters the scene tree for the first time. +func _ready(): + update() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(_delta): + if $StaticBody2D/CollisionShape2D2.disabled: + # Prepare the shape query parameters + var query_parameters = PhysicsShapeQueryParameters2D.new() + var collision_shape = $StaticBody2D/CollisionShape2D2.shape + query_parameters.set_shape(collision_shape) + query_parameters.set_transform(Transform2D(0, position)) + query_parameters.set_collision_mask(1) #1=players + + # Get the Physics2DDirectSpaceState for collision checking + var space_state = get_world_2d().direct_space_state + + # Check for collision + var collision_results = space_state.intersect_shape(query_parameters) + if collision_results.size() == 0: + $StaticBody2D/CollisionShape2D2.disabled=false + + update() + pass + +func update(): + var max_value: float = max(mana_r, mana_g, mana_b) + if max_value==0: + self.queue_free() + return; + var normalized_r = mana_r / max_value + var normalized_g = mana_g / max_value + var normalized_b = mana_b / max_value + + self.modulate = Color(normalized_r, normalized_g, normalized_b) + var s=sqrt((mana_r+mana_g+mana_b)/1000.0) + self.scale=Vector2(s,s) + self.queue_redraw() # Request to redraw the node + + +func _on_decay_timer_timeout(): + var new_player = load("res://player.tscn").instantiate() + + new_player.get_node("CharacterBody2D").velocity = Vector2.from_angle(randf_range(0, 2 * PI)) * 100 + new_player.get_node("CharacterBody2D").position = position + new_player.get_node("CharacterBody2D").exchange_with(self) + new_player.get_node("CharacterBody2D/CollisionShape2D").disabled=true + get_tree().root.add_child(new_player) diff --git a/TimerSS.gd b/TimerSS.gd new file mode 100644 index 0000000..f0622e4 --- /dev/null +++ b/TimerSS.gd @@ -0,0 +1,22 @@ +extends Timer + +var base_path = "user://screenshots/" +var session_path = "" +var count = 0 + +func _ready(): + # Generate a timestamp + var datetime = Time.get_datetime_dict_from_system() + var timestamp = "%d-%02d-%02d_%02d-%02d-%02d" % [datetime.year, datetime.month, datetime.day, datetime.hour, datetime.minute, datetime.second] + + # Create a session-specific subdirectory + session_path = base_path + timestamp + "/" + if not DirAccess.dir_exists_absolute(session_path): + DirAccess.make_dir_recursive_absolute(session_path) + + _on_timeout() + +func _on_timeout(): + var image = get_viewport().get_texture().get_image() + image.save_png(session_path + ("%010d"%count) + ".png") + count += 1 diff --git a/crosshair.tscn b/crosshair.tscn new file mode 100644 index 0000000..cfead64 --- /dev/null +++ b/crosshair.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=3 uid="uid://ckv0180aypptf"] + +[ext_resource type="Texture2D" uid="uid://1g54esg7yd35" path="res://images/crosshair.png" id="1_7vv1r"] + +[node name="Crosshair" type="Node2D"] + +[node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.05, 0.05) +texture = ExtResource("1_7vv1r") diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..61f890f --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,344 @@ +[preset.0] + +name="Android" +platform="Android" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +gradle_build/use_gradle_build=false +gradle_build/export_format=0 +gradle_build/min_sdk="" +gradle_build/target_sdk="" +architectures/armeabi-v7a=false +architectures/arm64-v8a=true +architectures/x86=false +architectures/x86_64=false +version/code=1 +version/name="1.0" +package/unique_name="org.godotengine.$genname" +package/name="" +package/signed=true +package/app_category=2 +package/retain_data_on_uninstall=false +package/exclude_from_recents=false +launcher_icons/main_192x192="" +launcher_icons/adaptive_foreground_432x432="" +launcher_icons/adaptive_background_432x432="" +graphics/opengl_debug=false +xr_features/xr_mode=0 +xr_features/hand_tracking=0 +xr_features/hand_tracking_frequency=0 +xr_features/passthrough=0 +screen/immersive_mode=true +screen/support_small=true +screen/support_normal=true +screen/support_large=true +screen/support_xlarge=true +user_data_backup/allow=false +command_line/extra_args="" +apk_expansion/enable=false +apk_expansion/SALT="" +apk_expansion/public_key="" +permissions/custom_permissions=PackedStringArray() +permissions/access_checkin_properties=false +permissions/access_coarse_location=false +permissions/access_fine_location=false +permissions/access_location_extra_commands=false +permissions/access_mock_location=false +permissions/access_network_state=false +permissions/access_surface_flinger=false +permissions/access_wifi_state=false +permissions/account_manager=false +permissions/add_voicemail=false +permissions/authenticate_accounts=false +permissions/battery_stats=false +permissions/bind_accessibility_service=false +permissions/bind_appwidget=false +permissions/bind_device_admin=false +permissions/bind_input_method=false +permissions/bind_nfc_service=false +permissions/bind_notification_listener_service=false +permissions/bind_print_service=false +permissions/bind_remoteviews=false +permissions/bind_text_service=false +permissions/bind_vpn_service=false +permissions/bind_wallpaper=false +permissions/bluetooth=false +permissions/bluetooth_admin=false +permissions/bluetooth_privileged=false +permissions/brick=false +permissions/broadcast_package_removed=false +permissions/broadcast_sms=false +permissions/broadcast_sticky=false +permissions/broadcast_wap_push=false +permissions/call_phone=false +permissions/call_privileged=false +permissions/camera=false +permissions/capture_audio_output=false +permissions/capture_secure_video_output=false +permissions/capture_video_output=false +permissions/change_component_enabled_state=false +permissions/change_configuration=false +permissions/change_network_state=false +permissions/change_wifi_multicast_state=false +permissions/change_wifi_state=false +permissions/clear_app_cache=false +permissions/clear_app_user_data=false +permissions/control_location_updates=false +permissions/delete_cache_files=false +permissions/delete_packages=false +permissions/device_power=false +permissions/diagnostic=false +permissions/disable_keyguard=false +permissions/dump=false +permissions/expand_status_bar=false +permissions/factory_test=false +permissions/flashlight=false +permissions/force_back=false +permissions/get_accounts=false +permissions/get_package_size=false +permissions/get_tasks=false +permissions/get_top_activity_info=false +permissions/global_search=false +permissions/hardware_test=false +permissions/inject_events=false +permissions/install_location_provider=false +permissions/install_packages=false +permissions/install_shortcut=false +permissions/internal_system_window=false +permissions/internet=false +permissions/kill_background_processes=false +permissions/location_hardware=false +permissions/manage_accounts=false +permissions/manage_app_tokens=false +permissions/manage_documents=false +permissions/manage_external_storage=false +permissions/master_clear=false +permissions/media_content_control=false +permissions/modify_audio_settings=false +permissions/modify_phone_state=false +permissions/mount_format_filesystems=false +permissions/mount_unmount_filesystems=false +permissions/nfc=false +permissions/persistent_activity=false +permissions/process_outgoing_calls=false +permissions/read_calendar=false +permissions/read_call_log=false +permissions/read_contacts=false +permissions/read_external_storage=false +permissions/read_frame_buffer=false +permissions/read_history_bookmarks=false +permissions/read_input_state=false +permissions/read_logs=false +permissions/read_phone_state=false +permissions/read_profile=false +permissions/read_sms=false +permissions/read_social_stream=false +permissions/read_sync_settings=false +permissions/read_sync_stats=false +permissions/read_user_dictionary=false +permissions/reboot=false +permissions/receive_boot_completed=false +permissions/receive_mms=false +permissions/receive_sms=false +permissions/receive_wap_push=false +permissions/record_audio=false +permissions/reorder_tasks=false +permissions/restart_packages=false +permissions/send_respond_via_message=false +permissions/send_sms=false +permissions/set_activity_watcher=false +permissions/set_alarm=false +permissions/set_always_finish=false +permissions/set_animation_scale=false +permissions/set_debug_app=false +permissions/set_orientation=false +permissions/set_pointer_speed=false +permissions/set_preferred_applications=false +permissions/set_process_limit=false +permissions/set_time=false +permissions/set_time_zone=false +permissions/set_wallpaper=false +permissions/set_wallpaper_hints=false +permissions/signal_persistent_processes=false +permissions/status_bar=false +permissions/subscribed_feeds_read=false +permissions/subscribed_feeds_write=false +permissions/system_alert_window=false +permissions/transmit_ir=false +permissions/uninstall_shortcut=false +permissions/update_device_stats=false +permissions/use_credentials=false +permissions/use_sip=false +permissions/vibrate=false +permissions/wake_lock=false +permissions/write_apn_settings=false +permissions/write_calendar=false +permissions/write_call_log=false +permissions/write_contacts=false +permissions/write_external_storage=false +permissions/write_gservices=false +permissions/write_history_bookmarks=false +permissions/write_profile=false +permissions/write_secure_settings=false +permissions/write_settings=false +permissions/write_sms=false +permissions/write_social_stream=false +permissions/write_sync_settings=false +permissions/write_user_dictionary=false + +[preset.1] + +name="Linux/X11" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="bin/alpha6.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=0 +binary_format/embed_pck=false +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" + +[preset.2] + +name="macOS" +platform="macOS" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.2.options] + +export/distribution_type=1 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="" +application/signature="" +application/app_category="Games" +application/short_version="1.0" +application/version="1.0" +application/copyright="" +application/copyright_localized={} +application/min_macos_version="10.12" +display/high_res=true +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=1 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" diff --git a/images/CrossHair.gif b/images/CrossHair.gif new file mode 100644 index 0000000..70e9541 Binary files /dev/null and b/images/CrossHair.gif differ diff --git a/images/crosshair.png b/images/crosshair.png new file mode 100644 index 0000000..fd0c408 Binary files /dev/null and b/images/crosshair.png differ diff --git a/images/crosshair.png.import b/images/crosshair.png.import new file mode 100644 index 0000000..cacb30d --- /dev/null +++ b/images/crosshair.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://1g54esg7yd35" +path="res://.godot/imported/crosshair.png-158d3b9e1b8650994ded77b707486b76.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/crosshair.png" +dest_files=["res://.godot/imported/crosshair.png-158d3b9e1b8650994ded77b707486b76.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 diff --git a/images/icon.svg b/images/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/images/icon.svg @@ -0,0 +1 @@ + diff --git a/images/icon.svg.import b/images/icon.svg.import new file mode 100644 index 0000000..755daba --- /dev/null +++ b/images/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ufohlmafhm3" +path="res://.godot/imported/icon.svg-40d11009b022ae281956dc38e8f8d85e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/icon.svg" +dest_files=["res://.godot/imported/icon.svg-40d11009b022ae281956dc38e8f8d85e.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 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/images/player.png b/images/player.png new file mode 100644 index 0000000..e391073 Binary files /dev/null and b/images/player.png differ diff --git a/images/player.png.import b/images/player.png.import new file mode 100644 index 0000000..af3d357 --- /dev/null +++ b/images/player.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://clyn507dro67" +path="res://.godot/imported/player.png-163753890810fa89776ed0f872fd9df1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/player.png" +dest_files=["res://.godot/imported/player.png-163753890810fa89776ed0f872fd9df1.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 diff --git a/images/pool.png b/images/pool.png new file mode 100644 index 0000000..72f9ef7 Binary files /dev/null and b/images/pool.png differ diff --git a/images/pool.png.import b/images/pool.png.import new file mode 100644 index 0000000..b020107 --- /dev/null +++ b/images/pool.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5bytgmfmgd2d" +path="res://.godot/imported/pool.png-4ce6214a9c177516d56e0dd3394db520.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/pool.png" +dest_files=["res://.godot/imported/pool.png-4ce6214a9c177516d56e0dd3394db520.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 diff --git a/map_select.tscn b/map_select.tscn new file mode 100644 index 0000000..43a5720 --- /dev/null +++ b/map_select.tscn @@ -0,0 +1,92 @@ +[gd_scene load_steps=3 format=3 uid="uid://iskh4m3ltqul"] + +[ext_resource type="Script" path="res://Button.gd" id="1_rygkg"] + +[sub_resource type="LabelSettings" id="LabelSettings_kd1xo"] +font_size = 32 + +[node name="MapSelect" type="Node2D"] + +[node name="Title" type="Label" parent="."] +offset_left = 27.0 +offset_top = 127.0 +offset_right = 196.0 +offset_bottom = 175.0 +text = "Map Select" +label_settings = SubResource("LabelSettings_kd1xo") + +[node name="Button" type="Button" parent="."] +offset_left = 24.0 +offset_top = 261.0 +offset_right = 199.0 +offset_bottom = 324.0 +text = "RGB" +script = ExtResource("1_rygkg") +map_path = "res://maps/rgb.tscn" + +[node name="Button2" type="Button" parent="."] +offset_left = 29.0 +offset_top = 186.0 +offset_right = 204.0 +offset_bottom = 249.0 +text = "Source" +script = ExtResource("1_rygkg") +map_path = "res://maps/source.tscn" + +[node name="Button3" type="Button" parent="."] +offset_left = 25.0 +offset_top = 332.0 +offset_right = 200.0 +offset_bottom = 395.0 +text = "CMY" +script = ExtResource("1_rygkg") +map_path = "res://maps/cmy.tscn" + +[node name="Button4" type="Button" parent="."] +offset_left = 397.0 +offset_top = 188.0 +offset_right = 572.0 +offset_bottom = 251.0 +text = "Rare" +script = ExtResource("1_rygkg") +map_path = "res://maps/rare.tscn" + +[node name="Button5" type="Button" parent="."] +offset_left = 213.0 +offset_top = 185.0 +offset_right = 388.0 +offset_bottom = 248.0 +text = "Seperated" +script = ExtResource("1_rygkg") +map_path = "res://maps/seperated.tscn" + +[node name="Button6" type="Button" parent="."] +offset_left = 208.0 +offset_top = 260.0 +offset_right = 383.0 +offset_bottom = 323.0 +text = "RGB Sections" +script = ExtResource("1_rygkg") +map_path = "res://maps/rgb_sections.tscn" + +[node name="Drop" type="CheckBox" parent="."] +offset_left = 33.0 +offset_top = 74.0 +offset_right = 194.0 +offset_bottom = 105.0 +text = "Drop on Collision" + +[node name="Title2" type="Label" parent="."] +offset_left = 24.0 +offset_top = 14.0 +offset_right = 193.0 +offset_bottom = 62.0 +text = "Options" +label_settings = SubResource("LabelSettings_kd1xo") + +[connection signal="pressed" from="Button" to="Button" method="_on_pressed"] +[connection signal="pressed" from="Button2" to="Button2" method="_on_pressed"] +[connection signal="pressed" from="Button3" to="Button3" method="_on_pressed"] +[connection signal="pressed" from="Button4" to="Button4" method="_on_pressed"] +[connection signal="pressed" from="Button5" to="Button5" method="_on_pressed"] +[connection signal="pressed" from="Button6" to="Button6" method="_on_pressed"] diff --git a/maps/cmy.tscn b/maps/cmy.tscn new file mode 100644 index 0000000..5e8cb3a --- /dev/null +++ b/maps/cmy.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=3 uid="uid://ce4ed87hyb1o3"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="2_u62jc"] + +[node name="Map" type="Node2D"] + +[node name="M" parent="." instance=ExtResource("2_u62jc")] +modulate = Color(1, 0, 1, 1) +position = Vector2(260, 209) +scale = Vector2(0.447214, 0.447214) +mana_r = 100 +mana_g = 0 +mana_b = 100 + +[node name="C" parent="." instance=ExtResource("2_u62jc")] +modulate = Color(0, 1, 1, 1) +position = Vector2(886, 210) +scale = Vector2(0.447214, 0.447214) +mana_r = 0 +mana_g = 100 +mana_b = 100 + +[node name="Y" parent="." instance=ExtResource("2_u62jc")] +modulate = Color(1, 1, 0, 1) +position = Vector2(583, 502) +scale = Vector2(0.447214, 0.447214) +mana_r = 100 +mana_g = 100 +mana_b = 0 diff --git a/maps/rare.tscn b/maps/rare.tscn new file mode 100644 index 0000000..014bfa0 --- /dev/null +++ b/maps/rare.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=3 uid="uid://bts7n21b8v8os"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="1_ivbwl"] + +[node name="Map" type="Node2D"] + +[node name="Red" parent="." instance=ExtResource("1_ivbwl")] +modulate = Color(1, 0, 0, 1) +position = Vector2(260, 209) +scale = Vector2(0.1, 0.1) +mana_r = 10 +mana_g = 0 +mana_b = 0 + +[node name="Green" parent="." instance=ExtResource("1_ivbwl")] +modulate = Color(0, 1, 0, 1) +position = Vector2(886, 210) +scale = Vector2(1, 1) +mana_r = 0 +mana_g = 1000 +mana_b = 0 + +[node name="Blue" parent="." instance=ExtResource("1_ivbwl")] +modulate = Color(0, 0, 1, 1) +position = Vector2(583, 502) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 diff --git a/maps/rgb.tscn b/maps/rgb.tscn new file mode 100644 index 0000000..2574fcc --- /dev/null +++ b/maps/rgb.tscn @@ -0,0 +1,29 @@ +[gd_scene load_steps=2 format=3 uid="uid://de5ghicw2skkg"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="1_icig8"] + +[node name="Map" type="Node2D"] + +[node name="Red" parent="." instance=ExtResource("1_icig8")] +modulate = Color(1, 0, 0, 1) +position = Vector2(260, 209) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Green" parent="." instance=ExtResource("1_icig8")] +modulate = Color(0, 1, 0, 1) +position = Vector2(886, 210) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Blue" parent="." instance=ExtResource("1_icig8")] +modulate = Color(0, 0, 1, 1) +position = Vector2(583, 502) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 diff --git a/maps/rgb_sections.tscn b/maps/rgb_sections.tscn new file mode 100644 index 0000000..c5c4f69 --- /dev/null +++ b/maps/rgb_sections.tscn @@ -0,0 +1,541 @@ +[gd_scene load_steps=2 format=3 uid="uid://65vslfrgjtly"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="2_caufp"] + +[node name="Map" type="Node2D"] + +[node name="Red" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(540, 177) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Green" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(779, 119) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Blue" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(722, 502) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Red2" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(513, 210) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red3" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(449, 250) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red4" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(196, 312) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red5" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(332, 287) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red6" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(597, 85) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red7" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(483, 229) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red8" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(259, 310) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red9" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(628, 13) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red10" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(561, 154) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red11" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(600, 47) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red12" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(164, 309) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red13" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(289, 288) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red14" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(410, 263) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red15" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(366, 273) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red16" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(581, 118) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Green2" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(775, 85) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green3" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(790, 161) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green4" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(823, 219) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green5" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(1145, 410) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green6" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(860, 273) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green7" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(1019, 374) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green8" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(1082, 396) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green9" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(1121, 403) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green10" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(773, 50) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green11" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(963, 342) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green12" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(842, 250) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green13" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(811, 185) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green14" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(770, 15) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green15" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(983, 363) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green16" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(1051, 384) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green17" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(941, 336) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Blue2" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(763, 511) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue3" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(803, 525) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue4" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(829, 534) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue5" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(933, 650) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue6" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(916, 631) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue7" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(362, 512) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue8" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(293, 588) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue9" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(698, 498) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue10" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(392, 494) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue11" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(336, 537) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue12" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(253, 646) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue13" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(662, 485) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue14" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(269, 616) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue15" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(878, 578) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue16" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(317, 561) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue17" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(626, 482) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue18" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(898, 606) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue19" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(853, 552) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Green18" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(885, 295) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Green19" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 1, 0, 1) +position = Vector2(914, 320) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 100 +mana_b = 0 + +[node name="Red17" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(259, 310) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red18" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(227, 310) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red19" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(3, 323) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red20" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(29, 325) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red21" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(56, 320) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red22" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(93, 318) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Red23" parent="." instance=ExtResource("2_caufp")] +modulate = Color(1, 0, 0, 1) +position = Vector2(131, 317) +scale = Vector2(0.316228, 0.316228) +mana_r = 100 +mana_g = 0 +mana_b = 0 + +[node name="Blue20" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(598, 476) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue21" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(564, 471) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue22" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(530, 466) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue23" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(491, 462) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue24" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(458, 468) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 + +[node name="Blue25" parent="." instance=ExtResource("2_caufp")] +modulate = Color(0, 0, 1, 1) +position = Vector2(428, 478) +scale = Vector2(0.316228, 0.316228) +mana_r = 0 +mana_g = 0 +mana_b = 100 diff --git a/maps/seperated.tscn b/maps/seperated.tscn new file mode 100644 index 0000000..60e158d --- /dev/null +++ b/maps/seperated.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=2 format=3 uid="uid://bc64eh8p22erv"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="1_uxair"] + +[node name="Map" type="Node2D"] + +[node name="Pool" parent="." instance=ExtResource("1_uxair")] +modulate = Color(1, 1, 1, 1) +position = Vector2(576, 106) +scale = Vector2(1.73205, 1.73205) +mana_r = 1000 +mana_g = 1000 +mana_b = 1000 + +[node name="Pool2" parent="." instance=ExtResource("1_uxair")] +modulate = Color(1, 1, 1, 1) +position = Vector2(568, 249) +scale = Vector2(1.73205, 1.73205) +mana_r = 1000 +mana_g = 1000 +mana_b = 1000 + +[node name="Pool3" parent="." instance=ExtResource("1_uxair")] +modulate = Color(1, 1, 1, 1) +position = Vector2(573, 390) +scale = Vector2(1.73205, 1.73205) +mana_r = 1000 +mana_g = 1000 +mana_b = 1000 + +[node name="Pool4" parent="." instance=ExtResource("1_uxair")] +modulate = Color(1, 1, 1, 1) +position = Vector2(573, 557) +scale = Vector2(1.73205, 1.73205) +mana_r = 1000 +mana_g = 1000 +mana_b = 1000 + +[node name="Pool5" parent="." instance=ExtResource("1_uxair")] +modulate = Color(1, 0, 0, 1) +position = Vector2(217, 331) +scale = Vector2(1, 1) +mana_r = 1000 +mana_g = 0 +mana_b = 0 + +[node name="Pool6" parent="." instance=ExtResource("1_uxair")] +modulate = Color(0, 1, 0, 1) +position = Vector2(927, 324) +scale = Vector2(1, 1) +mana_r = 0 +mana_g = 1000 +mana_b = 0 diff --git a/maps/source.tscn b/maps/source.tscn new file mode 100644 index 0000000..2d221cf --- /dev/null +++ b/maps/source.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=2 format=3 uid="uid://dh05x28usoabl"] + +[ext_resource type="PackedScene" uid="uid://bpd3l1iyb13h2" path="res://pool.tscn" id="2_3xoru"] + +[node name="Map" type="Node2D"] + +[node name="Pool" parent="." instance=ExtResource("2_3xoru")] +modulate = Color(1, 1, 1, 1) +position = Vector2(596, 330) +scale = Vector2(1.73205, 1.73205) +mana_r = 1000 +mana_g = 1000 +mana_b = 1000 diff --git a/physics/no_friction.tres b/physics/no_friction.tres new file mode 100644 index 0000000..225a039 --- /dev/null +++ b/physics/no_friction.tres @@ -0,0 +1,5 @@ +[gd_resource type="PhysicsMaterial" format=3 uid="uid://6vo1o6je0duv"] + +[resource] +friction = 0.0 +bounce = 1.0 diff --git a/player.gd b/player.gd new file mode 100644 index 0000000..17ec9df --- /dev/null +++ b/player.gd @@ -0,0 +1,114 @@ +class_name Player +extends Node2D + +var carrying_r=0 +var carrying_g=0 +var carrying_b=0 + +func _process(_delta): + if $Body2D/CollisionShape2D.disabled: + # Prepare the shape query parameters + var query_parameters = PhysicsShapeQueryParameters2D.new() + var collision_shape = $Body2D/CollisionShape2D.shape + query_parameters.set_shape(collision_shape) + query_parameters.set_transform(Transform2D(0, position)) + query_parameters.set_collision_mask(2) #2=pools + + # Get the Physics2DDirectSpaceState for collision checking + var space_state = get_world_2d().direct_space_state + + # Check for collision + var collision_results = space_state.intersect_shape(query_parameters) + if collision_results.size() == 0: + $Body2D/CollisionShape2D.disabled=false + +#func _physics_process(delta): +# if Input.is_action_pressed('move_up'): +# velocity.y -= 1 +# if Input.is_action_pressed('move_down'): +# velocity.y += 1 +# if Input.is_action_pressed('move_left'): +# velocity.x -= 1 +# if Input.is_action_pressed('move_right'): +# velocity.x += 1 +# if Input.is_action_just_pressed('take'): +# drop() +# +# var collision_info = move_and_collide(velocity * delta) +# if collision_info: +# velocity = velocity.bounce(collision_info.get_normal()) +# var collider=collision_info.get_collider(); +# if collider.get_parent() is Pool: +# exchange_with(collider.get_parent()) +# collider.get_parent().update() +# if collider.get_parent() is Player: +# drop() +# update() + +func drop(): + if not is_carrying(): + return + var new_pool: Pool = load("res://pool.tscn").instantiate() + new_pool.position = $Body2D.position + new_pool.mana_r=carrying_r + new_pool.mana_g=carrying_g + new_pool.mana_b=carrying_b + new_pool.get_node("StaticBody2D/CollisionShape2D2").disabled=true; + #new_pool.get_node("StaticBody2D/CollisionShape2D2").set_deferred("disabled", true) + carrying_r=0 + carrying_g=0 + carrying_b=0 + get_tree().root.get_node("Sim").call_deferred("add_child",new_pool) + update() + +func doubledrop(player: Player): + if not is_carrying() or not player.is_carrying(): + return + var new_pool: Pool = load("res://pool.tscn").instantiate() + new_pool.position = ($Body2D.position + player.get_node("Body2D").position ) /2 + new_pool.mana_r=carrying_r+player.carrying_r + new_pool.mana_g=carrying_g+player.carrying_g + new_pool.mana_b=carrying_b+player.carrying_b + new_pool.get_node("StaticBody2D/CollisionShape2D2").disabled=true; + carrying_r=0 + carrying_g=0 + carrying_b=0 + player.carrying_r=0 + player.carrying_g=0 + player.carrying_b=0 + get_tree().root.get_node("Sim").call_deferred("add_child",new_pool) + update() + +func exchange_with(pool: Pool): + if is_carrying(): + pool.mana_r+=carrying_r + pool.mana_g+=carrying_g + pool.mana_b+=carrying_b + carrying_r=0 + carrying_g=0 + carrying_b=0 + #position += velocity.normalized() #move away + else: + if pool.mana_r>0 and pool.mana_r >= pool.mana_g and pool.mana_r >= pool.mana_b: + pool.mana_r -= 1 + carrying_r=1 + elif pool.mana_g>0 and pool.mana_g >= pool.mana_r and pool.mana_g >= pool.mana_b: + pool.mana_g -= 1 + carrying_g=1 + elif pool.mana_b>0: + pool.mana_b -= 1 + carrying_b=1 + update() + +func update(): + var max_value = max(carrying_r, carrying_g, carrying_b) + if max_value==0: + self.modulate = Color(1, 1, 1, 1) + return + var normalized_r = carrying_r / max_value + var normalized_g = carrying_g / max_value + var normalized_b = carrying_b / max_value + self.modulate = Color(normalized_r, normalized_g, normalized_b) + +func is_carrying(): + return (carrying_r+carrying_g+carrying_b)>0 diff --git a/player.tscn b/player.tscn new file mode 100644 index 0000000..a878ebb --- /dev/null +++ b/player.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=6 format=3 uid="uid://bu6pswk806qv6"] + +[ext_resource type="Script" path="res://player.gd" id="1_kr26t"] +[ext_resource type="PhysicsMaterial" uid="uid://6vo1o6je0duv" path="res://physics/no_friction.tres" id="2_5k2ia"] +[ext_resource type="Texture2D" uid="uid://clyn507dro67" path="res://images/player.png" id="2_cxs7h"] +[ext_resource type="Script" path="res://Body2D.gd" id="3_rse87"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_yt706"] + +[node name="Player" type="Node2D"] +script = ExtResource("1_kr26t") + +[node name="Body2D" type="RigidBody2D" parent="."] +collision_mask = 7 +physics_material_override = ExtResource("2_5k2ia") +max_contacts_reported = 10 +contact_monitor = true +script = ExtResource("3_rse87") + +[node name="Mono-polygon" type="Sprite2D" parent="Body2D"] +scale = Vector2(0.1, 0.1) +texture = ExtResource("2_cxs7h") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Body2D"] +scale = Vector2(0.8, 0.8) +shape = SubResource("CircleShape2D_yt706") diff --git a/pool.tscn b/pool.tscn new file mode 100644 index 0000000..aaecbe9 --- /dev/null +++ b/pool.tscn @@ -0,0 +1,27 @@ +[gd_scene load_steps=4 format=3 uid="uid://bpd3l1iyb13h2"] + +[ext_resource type="Script" path="res://Pool.gd" id="1_tvic3"] +[ext_resource type="Texture2D" uid="uid://b5bytgmfmgd2d" path="res://images/pool.png" id="2_45evg"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_fmfn8"] + +[node name="Pool" type="Node2D"] +modulate = Color(0.3, 1, 1, 1) +scale = Vector2(0.151658, 0.151658) +script = ExtResource("1_tvic3") +mana_r = 3 + +[node name="StaticBody2D" type="StaticBody2D" parent="."] +collision_layer = 2 +collision_mask = 3 + +[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"] +scale = Vector2(8.5, 8.5) +shape = SubResource("CircleShape2D_fmfn8") + +[node name="Icon" type="Sprite2D" parent="StaticBody2D"] +texture = ExtResource("2_45evg") + +[node name="DecayTimer" type="Timer" parent="StaticBody2D"] + +[connection signal="timeout" from="StaticBody2D/DecayTimer" to="." method="_on_decay_timer_timeout"] diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..7f2ce72 --- /dev/null +++ b/project.godot @@ -0,0 +1,74 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="RGB Physics Life" +run/main_scene="res://map_select.tscn" +config/features=PackedStringArray("4.1", "Mobile") +config/icon="res://images/icon.svg" + +[display] + +window/size/resizable=false + +[input] + +move_up={ +"deadzone": 0.5, +"events": [null, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_down={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_left={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +take={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +click={ +"deadzone": 0.5, +"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":1,"position":Vector2(151, 21),"global_position":Vector2(155, 64),"factor":1.0,"button_index":1,"canceled":false,"pressed":true,"double_click":false,"script":null) +] +} +escape={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} + +[layer_names] + +2d_physics/layer_1="Players" +2d_physics/layer_2="Pools" +2d_physics/layer_3="Walls" + +[physics] + +2d/default_gravity=0.0 +2d/default_linear_damp=0.0 +2d/default_angular_damp=0.0 + +[rendering] + +renderer/rendering_method="mobile" diff --git a/sim.gd b/sim.gd new file mode 100644 index 0000000..f7a36fd --- /dev/null +++ b/sim.gd @@ -0,0 +1,83 @@ +extends Node2D + +var spawn_position=Vector2(100,100); + +# Called when the node enters the scene tree for the first time. +func _ready(): + setup_edge_collisions() + +func setup_edge_collisions(): + var screen_size = get_viewport_rect().size + + # Create a StaticBody2D for each edge + for i in range(4): + var body = StaticBody2D.new() + body.collision_layer=4 #walls + add_child(body) + + var shape = CollisionShape2D.new() + body.add_child(shape) + + var rect_shape = RectangleShape2D.new() + shape.shape = rect_shape + + # Adjust size and position based on the edge + match i: + 0: # Top + rect_shape.extents = Vector2(screen_size.x / 2, 10) + body.position = Vector2(screen_size.x / 2, 0) + 1: # Bottom + rect_shape.extents = Vector2(screen_size.x / 2, 10) + body.position = Vector2(screen_size.x / 2, screen_size.y) + 2: # Left + rect_shape.extents = Vector2(10, screen_size.y / 2) + body.position = Vector2(0, screen_size.y / 2) + 3: # Right + rect_shape.extents = Vector2(10, screen_size.y / 2) + body.position = Vector2(screen_size.x, screen_size.y / 2) + +func _input(event): + if event.is_action_pressed("escape"): + get_tree().change_scene_to_file("res://map_select.tscn") + get_node("/root/Sim").queue_free() + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: + spawn_position=event.position + spawn() + $Timer.stop() + if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_RIGHT: + spawn_position=event.position + $Timer.start() + +func _on_timer_timeout(): + spawn() + +func spawn(): + var new_player = load("res://player.tscn").instantiate() + new_player.get_node("Body2D").position = spawn_position + + new_player.get_node("Body2D").apply_impulse(Vector2.from_angle(randf_range(0, 2 * PI)) * 100) + + # Prepare the shape query parameters + var query_parameters = PhysicsShapeQueryParameters2D.new() + var collision_shape = new_player.get_node("Body2D/CollisionShape2D").shape + query_parameters.set_shape(collision_shape) + query_parameters.set_transform(Transform2D(0, spawn_position)) + query_parameters.set_collision_mask(1) + + # Get the Physics2DDirectSpaceState for collision checking + var space_state = get_world_2d().direct_space_state + + # Check for collision + var collision_results = space_state.intersect_shape(query_parameters) + if collision_results.size() == 0: + # No collision, safe to add child + add_child(new_player) + else: + for collision in collision_results: + #print + if collision.collider.get_parent() is Pool: + collision.collider.get_parent()._on_decay_timer_timeout() + return + var marker = load("res://crosshair.tscn").instantiate() + marker.position = new_player.get_node("Body2D").position + add_child(marker) diff --git a/sim.tscn b/sim.tscn new file mode 100644 index 0000000..38d7224 --- /dev/null +++ b/sim.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=4 format=3 uid="uid://bpy475nyq5ea1"] + +[ext_resource type="Script" path="res://sim.gd" id="1_wbm7g"] +[ext_resource type="Script" path="res://Debug.gd" id="2_iqnjl"] +[ext_resource type="Script" path="res://TimerSS.gd" id="3_7b3mn"] + +[node name="Sim" type="Node2D"] +script = ExtResource("1_wbm7g") + +[node name="Debug" type="Label" parent="."] +offset_right = 67.0 +offset_bottom = 26.0 +text = "debug" +script = ExtResource("2_iqnjl") + +[node name="Timer" type="Timer" parent="."] +wait_time = 0.3 + +[node name="TimerSS" type="Timer" parent="."] +wait_time = 60.0 +autostart = true +script = ExtResource("3_7b3mn") + +[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] +[connection signal="timeout" from="TimerSS" to="TimerSS" method="_on_timeout"]