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 index bf83296..4709183 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,2 @@ -# ---> Godot # Godot 4+ specific ignores .godot/ - -# Godot-specific ignores -.import/ -export.cfg -export_presets.cfg - -# Imported translations (automatically generated from CSV files) -*.translation - -# Mono-specific ignores -.mono/ -data_*/ -mono_crash.*.json - diff --git a/Game name.gd b/Game name.gd new file mode 100644 index 0000000..b3c1951 --- /dev/null +++ b/Game name.gd @@ -0,0 +1,16 @@ +extends Label + +var frequency = 5 +var amplitude = 550 +var time = 0 +# 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 + time += delta + var movement = cos(time*frequency)*amplitude + position.y+=movement * delta diff --git a/Label2.gd b/Label2.gd new file mode 100644 index 0000000..e130d31 --- /dev/null +++ b/Label2.gd @@ -0,0 +1,19 @@ +extends Label + +func _process(delta: float) -> void: + if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0: + Global.sk = true + if Global.sk: + _sk() + else: + if Global.firstrun: + set_text("Welcome to your first session "+OS.get_data_dir().rsplit("/", true, 7)[2]); + else: + set_text("Welcome back "+OS.get_data_dir().rsplit("/", true, 7)[2]); + +func _sk(): + set_text("Script Kiddie detected, only true hackers can cheat here"); + +func _input(event): + if Global.sk && (Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT) || Input.is_joy_button_pressed(0,JOY_BUTTON_Y) || Input.is_joy_button_pressed(0,JOY_BUTTON_A) || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK) || Input.is_joy_button_pressed(0,JOY_BUTTON_START) || Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) || Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_SHOULDER) || Input.is_key_pressed(KEY_ESCAPE) || Input.is_key_pressed(KEY_ENTER)): + get_tree().quit() diff --git a/README.md b/README.md index 01f16b6..90a0e16 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ -# midori-school +# Midori in the Magic School -An Action Role Playing Game inspired by TLOZ A Link to the Past and the only Open Source Genshin Killer. This game is made using Godot Engine \ No newline at end of file +An Action Role Playing Game inspired by TLOZ A Link to the Past and the only Open Source Genshin Killer. This game is made using Godot Engine +You can find game documentation at https://cloud.asgardius.company/s/3tPKHsMznzMjzEc?path=%2Fgame%20documentation%2FMidori%20in%20the%20Magic%20School diff --git a/backgounds/nebula_-_6044 (720p).ogv b/backgounds/nebula_-_6044 (720p).ogv new file mode 100644 index 0000000..1154c99 Binary files /dev/null and b/backgounds/nebula_-_6044 (720p).ogv differ diff --git a/bootclick.gd b/bootclick.gd new file mode 100644 index 0000000..00e2669 --- /dev/null +++ b/bootclick.gd @@ -0,0 +1,37 @@ +extends Node + +var title = preload("res://title.tscn").instantiate() +var boot = preload("res://bootclick.tscn").instantiate() +const loadgame = preload("res://load.gd") +const savegame = preload("res://save.gd") + +# Called when the node enters the scene tree for the first time. + +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + OS.get_data_dir().rsplit("/", true, 7)[2] + #loadgame.new() + #pass # Replace with function body. + #add_child(title) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _init(): + + +func _process(delta): + pass + +func _input(event): + # Mouse in viewport coordinates. + if !Global.sk && (event is InputEventMouseButton || Input.is_key_pressed(KEY_ENTER) || Input.is_joy_button_pressed(0,JOY_BUTTON_X) || Input.is_joy_button_pressed(0,JOY_BUTTON_Y) || Input.is_joy_button_pressed(0,JOY_BUTTON_A) || Input.is_joy_button_pressed(0,JOY_BUTTON_B) || Input.is_joy_button_pressed(0,JOY_BUTTON_BACK) || Input.is_joy_button_pressed(0,JOY_BUTTON_START) || Input.is_joy_button_pressed(0,JOY_BUTTON_RIGHT_SHOULDER) || Input.is_joy_button_pressed(0,JOY_BUTTON_LEFT_SHOULDER)): + #print("Mouse Click/Unclick at: ", event.position) + _title() + +func _title(): + # This is like autoloading the scene, only + # it happens after already loading the main scene. + get_tree().change_scene_to_file("res://title.tscn") + #get_tree().root.add_child(title) + #get_tree().root.remove_child(boot) + #boot.queue_free() diff --git a/bootclick.tscn b/bootclick.tscn new file mode 100644 index 0000000..4dad2a2 --- /dev/null +++ b/bootclick.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=4 format=3 uid="uid://b30uq5ye61dd6"] + +[ext_resource type="Script" path="res://bootclick.gd" id="1_52bti"] +[ext_resource type="Script" path="res://fps.gd" id="2_gnh1w"] +[ext_resource type="PackedScene" path="res://selftest.tscn" id="3_jtnh5"] + +[node name="bootclick" type="Control"] +layout_mode = 3 +anchors_preset = 0 +offset_right = 40.0 +offset_bottom = 40.0 +script = ExtResource("1_52bti") + +[node name="Label" type="Label" parent="."] +layout_mode = 0 +offset_left = 105.0 +offset_top = 258.0 +offset_right = 453.0 +offset_bottom = 284.0 +scale = Vector2(2.94857, 7.68) +text = "Press enter or a gamepad button to continue" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="fps" type="Label" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 23.0 +script = ExtResource("2_gnh1w") + +[node name="Selftest" parent="." instance=ExtResource("3_jtnh5")] +layout_mode = 0 +offset_left = 57.0 +offset_top = 112.0 +offset_right = 97.0 +offset_bottom = 135.0 diff --git a/exit.gd b/exit.gd new file mode 100644 index 0000000..5d350ab --- /dev/null +++ b/exit.gd @@ -0,0 +1,16 @@ +extends Label + +var frequency = 5 +var amplitude = 550 +var time = 0 +# 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 + time += delta + var movement = -cos(time*frequency)*amplitude + position.x+=movement * delta diff --git a/fps.gd b/fps.gd new file mode 100644 index 0000000..c2c9da1 --- /dev/null +++ b/fps.gd @@ -0,0 +1,4 @@ +extends Label + +func _process(delta: float) -> void: + set_text("FPS: " + str(Engine.get_frames_per_second())); diff --git a/global.gd b/global.gd new file mode 100644 index 0000000..30ca484 --- /dev/null +++ b/global.gd @@ -0,0 +1,23 @@ +extends Node + +var live +var time +var origmpos +var mousepos +var timelimit = 15000 +var wait +var hiscoresfile = "user://hiscores.save" +var gamelevel +var levelmax +var firstrun +var sk = false +var xm = 0 +var ym = 0 +# 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 diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..c60cde5 Binary files /dev/null and b/icon.png differ diff --git a/icon.png.import b/icon.png.import new file mode 100644 index 0000000..4b60ada --- /dev/null +++ b/icon.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7r0nvyn1c1pp" +path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.png" +dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.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/load.gd b/load.gd new file mode 100644 index 0000000..d3e20d0 --- /dev/null +++ b/load.gd @@ -0,0 +1,23 @@ +extends Node +var file +func _init(): + if FileAccess.file_exists(Global.hiscoresfile): + Global.firstrun = false + file = FileAccess.open(Global.hiscoresfile, FileAccess.READ) + Global.levelmax = file.get_as_text().rsplit(",", true, 7) + # We need to revert the game state so we're not cloning objects + # during loading. This will vary wildly depending on the needs of a + # project, so take care with this step. + # For our example, we will accomplish this by deleting saveable objects. + #var save_nodes = get_tree().get_nodes_in_group("Persist") + #for i in save_nodes: + # i.queue_free() + + # Load the file line by line and process that dictionary to restore + # the object it represents. + else: + #Global.firstrun = true + var saveinit = "9999999,9999999,9999999,9999999,9999999,9999999,9999999" + var file = FileAccess.open(Global.hiscoresfile, FileAccess.WRITE) + file.store_string(saveinit) + Global.levelmax = saveinit.rsplit(",", true, 7) diff --git a/music/reloaded.wav b/music/reloaded.wav new file mode 100644 index 0000000..4d62252 Binary files /dev/null and b/music/reloaded.wav differ diff --git a/music/reloaded.wav.import b/music/reloaded.wav.import new file mode 100644 index 0000000..9049568 --- /dev/null +++ b/music/reloaded.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dxr5osnvkyygn" +path="res://.godot/imported/reloaded.wav-1ebd07a17eda8ffb2d6c5c06bcc56aa1.sample" + +[deps] + +source_file="res://music/reloaded.wav" +dest_files=["res://.godot/imported/reloaded.wav-1ebd07a17eda8ffb2d6c5c06bcc56aa1.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=2 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/nebula.gd b/nebula.gd new file mode 100644 index 0000000..c1d331a --- /dev/null +++ b/nebula.gd @@ -0,0 +1,16 @@ +extends VideoStreamPlayer + + +# 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 _on_finished(): + play() + #pass # Replace with function body. diff --git a/player.gd b/player.gd new file mode 100644 index 0000000..4098686 --- /dev/null +++ b/player.gd @@ -0,0 +1,12 @@ +extends Sprite2D + +var angular_speed = PI +# 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): + rotation += angular_speed * delta + #pass diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..2939bab --- /dev/null +++ b/project.godot @@ -0,0 +1,32 @@ +; 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="Midori in the Magic School" +run/main_scene="res://bootclick.tscn" +config/features=PackedStringArray("4.2", "GL Compatibility") +config/icon="res://icon.png" + +[autoload] + +Global="*res://global.gd" + +[display] + +window/size/viewport_width=1280 +window/size/viewport_height=720 +window/stretch/mode="viewport" + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" +environment/defaults/default_clear_color=Color(0, 0, 0, 1) diff --git a/save.gd b/save.gd new file mode 100644 index 0000000..549aac5 --- /dev/null +++ b/save.gd @@ -0,0 +1,6 @@ +extends Node +func _init(): + var saveinit = Global.levelmax[0]+","+Global.levelmax[1]+","+Global.levelmax[2]+","+Global.levelmax[3]+","+Global.levelmax[4]+","+Global.levelmax[5]+","+Global.levelmax[6] + var file = FileAccess.open(Global.hiscoresfile, FileAccess.WRITE) + file.store_string(saveinit) + file.close() diff --git a/selftest.tscn b/selftest.tscn new file mode 100644 index 0000000..4a23f4f --- /dev/null +++ b/selftest.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=2 format=3 uid="uid://dblfov80ngodu"] + +[ext_resource type="Script" path="res://Label2.gd" id="1_2bvs5"] + +[node name="Selftest" type="Label"] +offset_left = 77.0 +offset_top = 94.0 +offset_right = 117.0 +offset_bottom = 117.0 +script = ExtResource("1_2bvs5") diff --git a/start.gd b/start.gd new file mode 100644 index 0000000..a4f33f4 --- /dev/null +++ b/start.gd @@ -0,0 +1,16 @@ +extends Label + +var frequency = 5 +var amplitude = 550 +var time = 0 +# 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 + time += delta + var movement = cos(time*frequency)*amplitude + position.x+=movement * delta diff --git a/title.gd b/title.gd new file mode 100644 index 0000000..922e3cf --- /dev/null +++ b/title.gd @@ -0,0 +1,49 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +var bgsound := AudioStreamPlayer.new() +var wait +#var galaxy = preload("res://backgounds/galaxy.tscn").instantiate() +#var wormhole = preload("res://backgounds/wormhole.tscn").instantiate() + +func _ready(): + Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN) + if (OS.get_name() != "Linux" && !OS.get_name().ends_with("BSD")) || OS.get_distribution_name().contains("Kali") || !OS.get_data_dir().begins_with("/home") || OS.get_environment("WSL_DISTRO_NAME").length() < 0: + Global.sk = true + Global.gamelevel = null + add_child(bgsound) + var titlemusic = load("res://music/reloaded.wav") + bgsound.stream = titlemusic + bgsound.play(0) + wait = Time.get_ticks_msec() + #pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _input(event): + # Mouse in viewport coordinates. + if (Time.get_ticks_msec() - wait) >= 1000 && (event is InputEventMouseButton || Input.is_key_pressed(KEY_ENTER) || Input.is_joy_button_pressed(0,JOY_BUTTON_A)): + #print("Mouse Click/Unclick at: ", event.position) + #_level() + print("There are not game levels at the moment") + elif (Time.get_ticks_msec() - wait) >= 1000 && (Input.is_key_pressed(KEY_ESCAPE) || Input.is_joy_button_pressed(0,JOY_BUTTON_B)): + get_tree().quit() + +func _level(): + # This is like autoloading the scene, only + # it happens after already loading the main scene. + Global.live = 1 + Global.gamelevel = randi() % 3 + if Global.gamelevel == 0: + get_tree().change_scene_to_file("res://backgounds/galaxy.tscn") + elif Global.gamelevel == 1: + get_tree().change_scene_to_file("res://backgounds/wormhole.tscn") + else: + get_tree().change_scene_to_file("res://backgounds/abstract.tscn") + #get_tree().root.add_child(title) + #get_tree().root.remove_child(boot) + #boot.queue_free() diff --git a/title.tscn b/title.tscn new file mode 100644 index 0000000..1298c25 --- /dev/null +++ b/title.tscn @@ -0,0 +1,74 @@ +[gd_scene load_steps=8 format=3 uid="uid://ccckve5n0xbh4"] + +[ext_resource type="Script" path="res://title.gd" id="1_fbo7u"] +[ext_resource type="Script" path="res://Game name.gd" id="2_bbb0f"] +[ext_resource type="VideoStream" path="res://backgounds/nebula_-_6044 (720p).ogv" id="2_dxhuu"] +[ext_resource type="Script" path="res://nebula.gd" id="3_bn1r3"] +[ext_resource type="Script" path="res://fps.gd" id="3_tsoef"] +[ext_resource type="Script" path="res://start.gd" id="4_cc41w"] +[ext_resource type="Script" path="res://exit.gd" id="5_scoec"] + +[node name="title" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_fbo7u") + +[node name="nebula" type="VideoStreamPlayer" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 +scale = Vector2(2, 1.96) +stream = ExtResource("2_dxhuu") +autoplay = true +script = ExtResource("3_bn1r3") + +[node name="fps" type="Label" parent="."] +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 23.0 +script = ExtResource("3_tsoef") + +[node name="Game name" type="Label" parent="."] +layout_mode = 0 +offset_left = 31.0 +offset_top = 308.0 +offset_right = 235.0 +offset_bottom = 331.0 +scale = Vector2(5.86131, 5.35486) +text = "Midori in the Magic School" +script = ExtResource("2_bbb0f") + +[node name="start" type="Label" parent="."] +layout_mode = 0 +offset_left = 446.0 +offset_top = 92.0 +offset_right = 610.0 +offset_bottom = 118.0 +scale = Vector2(2.61468, 1.57466) +text = "Press A or Enter start" +script = ExtResource("4_cc41w") + +[node name="exit" type="Label" parent="."] +layout_mode = 0 +offset_left = 364.0 +offset_top = 602.0 +offset_right = 568.0 +offset_bottom = 628.0 +scale = Vector2(2.61468, 1.57466) +text = "Press escape or B to exit" +script = ExtResource("5_scoec") + +[node name="Label" type="Label" parent="."] +layout_mode = 0 +offset_left = 36.0 +offset_top = 653.0 +offset_right = 76.0 +offset_bottom = 676.0 +text = "R0.0.0-dev 2023 Page Asgardius GNU General Public License 3 +2016-2023 Asgardius Virtualx Project" + +[connection signal="finished" from="nebula" to="nebula" method="_on_finished"]