Skip to content

Commit

Permalink
Organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
psychowolf960 committed May 3, 2024
1 parent 81f69f0 commit 1a7bbe8
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 108 deletions.
8 changes: 4 additions & 4 deletions .godot/editor/editor_layout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dock_filesystem_split=0
dock_filesystem_display_mode=0
dock_filesystem_file_sort=0
dock_filesystem_file_list_display_mode=1
dock_filesystem_selected_paths=PackedStringArray("res://scripts/player.gd")
dock_filesystem_selected_paths=PackedStringArray("res://scripts/")
dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scripts/", "res://scenes/", "res://assets/", "res://assets/sprites/", "res://assets/fonts/")
dock_3="Scene,Import"
dock_4="FileSystem"
Expand All @@ -32,12 +32,12 @@ current_scene="res://scenes/mainmenu.tscn"
center_split_offset=-288
selected_default_debugger_tab_idx=0
selected_main_editor_idx=2
selected_bottom_panel_item=1
selected_bottom_panel_item=0

[ScriptEditor]

open_scripts=["res://mainmenu.gd", "res://scenes/MarginContainer2.gd", "res://scripts/player.gd"]
selected_script="res://mainmenu.gd"
open_scripts=["res://scripts/mainmenu.gd", "res://scenes/MarginContainer2.gd", "res://scripts/player.gd"]
selected_script="res://scripts/mainmenu.gd"
open_help=[]
script_split_offset=70
list_split_offset=0
Expand Down
9 changes: 4 additions & 5 deletions .godot/editor/filesystem_cache8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ea4bc82a6ad023ab7ee23ee620429895
::res://::1714723719
::res://::1714724197
default_bus_layout.tres::AudioBusLayout::6154612993266235982::1714267924::0::1::::<><>::
icon.svg::CompressedTexture2D::6469127827471254761::1714267924::1714564333::1::::<><>::
mainmenu.gd::GDScript::-1::1714682533::0::1::::<>Control<>::
Expand All @@ -26,12 +26,12 @@ slime_green.png::CompressedTexture2D::3222140907498469096::1714267924::171456433
slime_purple.png::CompressedTexture2D::3959724587980025257::1714267924::1714564334::1::::<><>::
tileset_mk_16_16_nature_tileset_godot.png::CompressedTexture2D::3099737582622070004::1614636818::1714663521::1::::<><>::
world_tileset.png::CompressedTexture2D::263196027477670198::1714267924::1714564333::1::::<><>::
::res://scenes/::1714682533
::res://scenes/::1714725469
coin.tscn::PackedScene::1086827868758606395::1714649078::0::1::::<><>::uid://bped01tsjeycn::::res://assets/sprites/coin.png<>res://scripts/coin.gd<>uid://hxv3svfwkg67::::res://assets/sounds/coin.wav
game.tscn::PackedScene::6221769105244979977::1714663662::0::1::::<><>::uid://dqnaqj8yb6hwd::::res://scenes/player.tscn<>res://scripts/gamemanager.gd<>uid://c53kogtyjwsss::::res://assets/fonts/PixelOperator8-Bold.ttf<>uid://d0q2g65ahgok::::res://assets/sprites/world_tileset.png<>uid://bgv5v2fxqlswe::::res://scenes/platform.tscn<>uid://pqp5qaw561fr::::res://scenes/coin.tscn<>uid://bkfshwhwsgkwq::::res://assets/sprites/tileset_mk_16_16_nature_tileset_godot.png<>res://scenes/killzone.tscn<>uid://duj85jkd1ay6m::::res://scenes/slime.tscn<>uid://dbjl1e6kdxpl6::::res://assets/fonts/PixelOperator8.ttf
killzone.tscn::PackedScene::-1::1714267924::0::1::::<><>::
level1.tscn::PackedScene::708535710287922101::1714664557::0::1::::<><>::res://scripts/gamemanager.gd<>uid://dbjl1e6kdxpl6::::res://assets/fonts/PixelOperator8.ttf<>uid://d0q2g65ahgok::::res://assets/sprites/world_tileset.png<>uid://pqp5qaw561fr::::res://scenes/coin.tscn<>uid://bkfshwhwsgkwq::::res://assets/sprites/tileset_mk_16_16_nature_tileset_godot.png<>uid://dqnaqj8yb6hwd::::res://scenes/player.tscn<>res://scenes/killzone.tscn<>uid://bgv5v2fxqlswe::::res://scenes/platform.tscn<>uid://duj85jkd1ay6m::::res://scenes/slime.tscn
mainmenu.tscn::PackedScene::5060128894474056495::1714682533::0::1::::<><>::res://mainmenu.gd<>uid://dbjl1e6kdxpl6::::res://assets/fonts/PixelOperator8.ttf<>res://scenes/MarginContainer2.gd<>uid://cyfxuch6qa87f::::res://icon.svg
mainmenu.tscn::PackedScene::5060128894474056495::1714725502::0::1::::<><>::res://mainmenu.gd<>uid://dbjl1e6kdxpl6::::res://assets/fonts/PixelOperator8.ttf<>res://scenes/MarginContainer2.gd<>uid://cyfxuch6qa87f::::res://icon.svg
MarginContainer2.gd::GDScript::-1::1714675192::0::1::::<>MarginContainer<>::
music.tscn::PackedScene::789652015453189431::1714569304::0::1::::<><>::uid://m73dm4jhs3eq::::res://assets/music/time_for_adventure.mp3
optionsmenu.gd::GDScript::-1::1714577650::0::1::::<>Control<>::
Expand All @@ -41,10 +41,9 @@ player.tscn::PackedScene::8309149557574787539::1714663662::0::1::::<><>::res://s
slime.tscn::PackedScene::8583676046534204298::1714649078::0::1::::<><>::uid://bl53gpvg5mh1y::::res://assets/sprites/slime_green.png<>res://scripts/slime.gd<>res://scenes/killzone.tscn
tileset_mk_16_16_nature_tileset_godot.png::CompressedTexture2D::8234780569853670918::1714663446::1714663446::1::::<><>::
tileset_mk_16_16_nature_tileset_godot.tres::TileSet::-1::1714663455::0::1::::<><>::res://scenes/tileset_mk_16_16_nature_tileset_godot.png
::res://scripts/::1714662653
::res://scripts/::1714725497
coin.gd::GDScript::-1::1714662653::0::1::::<>Area2D<>::
gamemanager.gd::GDScript::-1::1714662341::0::1::::<>Node<>::
killzone.gd::GDScript::-1::1714267924::0::1::::<>Area2D<>::
mainmenu.gd::GDScript::-1::1714577004::0::1::::<>Control<>::
player.gd::GDScript::-1::1714660830::0::1::::<>CharacterBody2D<>::
slime.gd::GDScript::-1::1714567004::0::1::::<>Node2D<>::
1 change: 0 additions & 1 deletion .godot/editor/filesystem_update4
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
res://scenes/mainmenu.tscn
res://mainmenu.gd
42 changes: 14 additions & 28 deletions .godot/editor/script_editor_cache.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,6 @@ state={
"syntax_highlighter": "GDScript"
}

[res://scripts/mainmenu.gd]

state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 65,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 7,
"scroll_position": 0.0,
"selection": false,
"syntax_highlighter": "GDScript"
}

[res://scenes/optionsmenu.gd]

state={
Expand All @@ -72,20 +58,6 @@ state={
"syntax_highlighter": "GDScript"
}

[res://mainmenu.gd]

state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 28,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 30,
"scroll_position": 27.0,
"selection": false,
"syntax_highlighter": "GDScript"
}

[res://scripts/player.gd]

state={
Expand Down Expand Up @@ -131,3 +103,17 @@ state={
"selection": false,
"syntax_highlighter": "GDScript"
}

[res://scripts/mainmenu.gd]

state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 30,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 46,
"scroll_position": 18.0,
"selection": false,
"syntax_highlighter": "GDScript"
}
65 changes: 0 additions & 65 deletions mainmenu.gd

This file was deleted.

2 changes: 1 addition & 1 deletion scenes/mainmenu.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://cedft3vy5hg68"]

[ext_resource type="Script" path="res://mainmenu.gd" id="1_qj2ne"]
[ext_resource type="Script" path="res://scripts/mainmenu.gd" id="1_qj2ne"]
[ext_resource type="FontFile" uid="uid://dbjl1e6kdxpl6" path="res://assets/fonts/PixelOperator8.ttf" id="2_h05dh"]
[ext_resource type="Script" path="res://scenes/MarginContainer2.gd" id="3_rb1ce"]
[ext_resource type="Texture2D" uid="uid://cyfxuch6qa87f" path="res://icon.svg" id="3_tlb1w"]
Expand Down
60 changes: 56 additions & 4 deletions scripts/mainmenu.gd
Original file line number Diff line number Diff line change
@@ -1,13 +1,65 @@
extends Control

class World:
var label: String
var x: int

func _init(initial_label: String):
self.label = initial_label
self.x = 0
@onready var world_1 = $MarginContainer2/World1
@onready var world_4 = $MarginContainer2/World4
@onready var world_2 = $MarginContainer2/World2
@onready var world_3 = $MarginContainer2/World3

var middle_index: int
var animation_duration: float
var animation_step: float

func animate_sliding(direction: String):
if direction == "right":
_start_animation_right()

var worlds = [world_1, world_2, world_3, world_4]
var world_indices = {world_1: 1, world_2: 2, world_3: 3, world_4: 4}
var animation_in_progress = false

func _start_animation_right():
animation_in_progress = true
for world in worlds:
if world_indices[world] == 4:
world_indices[world] = 1
else:
world_indices[world] += 1
for world in worlds:
if world_indices[world] == 1:
world.set_position(Vector2(-185, 0))
world.show()
elif world_indices[world] == 2:
world.set_position(Vector2(0, 0))
world.show()
elif world_indices[world] == 3:
world.set_position(Vector2(185, 0))
world.show()
elif world_indices[world] == 4:
world.set_position(Vector2(185, 0))
world.hide()
animation_in_progress = false

func _on_play_pressed():
get_tree().change_scene_to_file("res://scenes/game.tscn")


func _on_options_pressed():
get_tree().change_scene_to_file("res://scenes/optionsmenu.tscn")


get_tree().change_scene_to_file("res://scenes/optionsmenu.tscn")

func _on_exit_pressed():
get_tree().quit()

func _input(event: InputEvent):
if event is InputEventKey:
if Input.is_action_just_pressed("ui_right") and not animation_in_progress:
print("gay")
animate_sliding("right")
elif Input.is_action_just_pressed("ui_left") and not animation_in_progress:
print("work")
animate_sliding("left")

0 comments on commit 1a7bbe8

Please sign in to comment.