template init
This commit is contained in:
parent
2e6c7dc330
commit
c683bb2da5
24 changed files with 452 additions and 17 deletions
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
15
.gitignore
vendored
15
.gitignore
vendored
|
@ -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
|
||||
|
||||
|
|
16
Game name.gd
Normal file
16
Game name.gd
Normal file
|
@ -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
|
19
Label2.gd
Normal file
19
Label2.gd
Normal file
|
@ -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()
|
|
@ -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
|
||||
You can find game documentation at https://cloud.asgardius.company/s/3tPKHsMznzMjzEc?path=%2Fgame%20documentation%2FMidori%20in%20the%20Magic%20School
|
||||
|
|
BIN
backgounds/nebula_-_6044 (720p).ogv
Normal file
BIN
backgounds/nebula_-_6044 (720p).ogv
Normal file
Binary file not shown.
37
bootclick.gd
Normal file
37
bootclick.gd
Normal file
|
@ -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()
|
36
bootclick.tscn
Normal file
36
bootclick.tscn
Normal file
|
@ -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
|
16
exit.gd
Normal file
16
exit.gd
Normal file
|
@ -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
|
4
fps.gd
Normal file
4
fps.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Label
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
set_text("FPS: " + str(Engine.get_frames_per_second()));
|
23
global.gd
Normal file
23
global.gd
Normal file
|
@ -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
|
BIN
icon.png
Normal file
BIN
icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
34
icon.png.import
Normal file
34
icon.png.import
Normal file
|
@ -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
|
23
load.gd
Normal file
23
load.gd
Normal file
|
@ -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)
|
BIN
music/reloaded.wav
Normal file
BIN
music/reloaded.wav
Normal file
Binary file not shown.
24
music/reloaded.wav.import
Normal file
24
music/reloaded.wav.import
Normal file
|
@ -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
|
16
nebula.gd
Normal file
16
nebula.gd
Normal file
|
@ -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.
|
12
player.gd
Normal file
12
player.gd
Normal file
|
@ -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
|
32
project.godot
Normal file
32
project.godot
Normal file
|
@ -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)
|
6
save.gd
Normal file
6
save.gd
Normal file
|
@ -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()
|
10
selftest.tscn
Normal file
10
selftest.tscn
Normal file
|
@ -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")
|
16
start.gd
Normal file
16
start.gd
Normal file
|
@ -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
|
49
title.gd
Normal file
49
title.gd
Normal file
|
@ -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()
|
74
title.tscn
Normal file
74
title.tscn
Normal file
|
@ -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"]
|
Loading…
Reference in a new issue