Initial Commit

This commit is contained in:
2024-09-17 07:45:51 -04:00
commit c9cb61faa7
28 changed files with 1360 additions and 0 deletions

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

3
AI.gd Normal file
View File

@@ -0,0 +1,3 @@
extends CharacterBody2D
var int_value: int = 200

19
AI.tscn Normal file
View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://f7k4q00o2gnq"]
[ext_resource type="Script" path="res://AI.gd" id="1_8upf1"]
[ext_resource type="Texture2D" uid="uid://bpuvmnj2uuavs" path="res://icon.svg" id="1_ckmxs"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_w7ywt"]
size = Vector2(16, 16)
[node name="AI" type="CharacterBody2D"]
script = ExtResource("1_8upf1")
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(40, 40)
scale = Vector2(0.125, 0.125)
texture = ExtResource("1_ckmxs")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(40, 40)
shape = SubResource("RectangleShape2D_w7ywt")

BIN
Brown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

34
Brown.png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://75ue47s4k2cg"
path="res://.godot/imported/Brown.png-150dcd85596b8e4cffe30274d1cab3fe.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Brown.png"
dest_files=["res://.godot/imported/Brown.png-150dcd85596b8e4cffe30274d1cab3fe.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

74
Data_Class.gd Normal file
View File

@@ -0,0 +1,74 @@
extends Node
class_name Data
#***** Gain Access to the Different Classes *****
var Right : bool
var Left : bool
var Up : bool
var Down : bool
var Current_Position : Array
# *****Data vars ******
#Arrays
var ways = ["None", "Dead End", "Plain Path", "3 Way Intersection", "4 Way Intersection"]
var Cords = [[0,0]]
#Dictionaries
var Coordinate_Dict = {"Position": [0,0]}
var Detail_Dict = { "Type": "",
"Came_From": "",
"Been_There": false}
#Single Vars
var Traveled = false
var State = 0
#***** Functions *****
func _process(delta):
Mark()
IntersectionCounter()
Been_There()
func IntersectionCounter():
var WaysToGo = 0
var Directions = [Right,Left,Down,Up]
for Direction in Directions:
if Direction == false:
WaysToGo += 1
if Direction == true:
pass
return WaysToGo
func Mark():
var response = ways[IntersectionCounter()]
Detail_Dict.Type = response
Detail_Dict.Came_From = "Hi"#Prev_dir
Detail_Dict.Been_There = Traveled
print(Current_Position)
func Been_There():
if Cords.find(Current_Position) == -1:
Cords.push_back(Current_Position)
var Cords_Copy = Cords.duplicate(true)
Cords = Cords_Copy
Traveled = false
else:
Traveled = true

17
Forwardv.gd Normal file
View File

@@ -0,0 +1,17 @@
extends RayCast2D
# 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):
if is_colliding():
#print("True")
var Forward: bool = true
else:
#print("False")
var Forward: bool = false

BIN
Jump (32x32).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 769 B

34
Jump (32x32).png.import Normal file
View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://crkasykc6x5i"
path="res://.godot/imported/Jump (32x32).png-91bf01789c567d31f5c28cd22911709b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Jump (32x32).png"
dest_files=["res://.godot/imported/Jump (32x32).png-91bf01789c567d31f5c28cd22911709b.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

16
Leftv.gd Normal file
View File

@@ -0,0 +1,16 @@
extends RayCast2D
# 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):
if is_colliding():
#print("True")
var right: bool = true
else:
#print("False")
var right: bool = false

10
Main_player.tscn Normal file
View File

@@ -0,0 +1,10 @@
[gd_scene load_steps=3 format=3 uid="uid://3iw0nxyxa7su"]
[ext_resource type="Script" path="res://PlayerScript.gd" id="1_682sr"]
[ext_resource type="Texture2D" uid="uid://crkasykc6x5i" path="res://Jump (32x32).png" id="1_hfcsn"]
[node name="Player" type="CharacterBody2D"]
script = ExtResource("1_682sr")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_hfcsn")

107
Movement_Class.gd Normal file
View File

@@ -0,0 +1,107 @@
extends Node
class_name Movement
#Setting up Other Classes
const Data = preload("res://Movement_Class.gd")
#Defining Raycasts
var Right : bool
var Left : bool
var Up : bool
var Down : bool
#External Data
var Detail_Dict: Dictionary
#Internal Data
var Prev_dir = ""
var Prev_dir_Opp = ""
var Current_Position = [0,0]
# Misc
var move = 0
var Move_Strength = 1
var State = 0
func _process(delta):
pass
func goDown():
var Data_Class = Data.new()
if Down == false:
Current_Position[1] -=1
print(Current_Position)
Prev_dir = "D"
Prev_dir_Opp = "U"
move += Move_Strength
Data_Class.Current_Position = Current_Position
else:
move += Move_Strength
print("There is something below you")
func goUp():
var Data_Class = Data.new()
if Up == false:
Current_Position[1] +=1
print(Current_Position)
Prev_dir = "U"
Prev_dir_Opp = "D"
move += Move_Strength
Data_Class.Current_Position = Current_Position
else:
move += Move_Strength
print("There is something above you")
func goRight():
var Data_Class = Data.new()
if Right == false:
Current_Position[0] +=1
print(Current_Position)
Prev_dir = "R"
Prev_dir_Opp = "L"
move += Move_Strength
Data_Class.Current_Position = Current_Position
else:
move += Move_Strength
print("There is something to your right")
func goLeft():
var Data_Class = Data.new()
if Left == false:
Current_Position[0] -=1
print(Current_Position)
Prev_dir = "L"
Prev_dir_Opp = "R"
move += Move_Strength
Data_Class.Current_Position = Current_Position
else:
move += Move_Strength
print("There is something to your left")
func WhatMove():
pass
if Detail_Dict.Been_There == true:
if State != 1:
Move_Strength = 0
move = move - 1
State = 1
if Detail_Dict.Been_There == false:
if State != 2:
Move_Strength = 1
move = move + 1
State = 2

581
PlayerScript.gd Normal file
View File

@@ -0,0 +1,581 @@
extends CharacterBody2D
var Check = 0
var dir = Vector2.ZERO
var Current_Position = [0,0]
var Cords = [[0,0]]
var Cords_Copy = []
var Intersections = [[]]
var Intersections_Copy = []
var Moves_From_Last_Intersection = []
var Moves_From_Last_Intersection_Copy = []
var Back_From_DeadEnd = []
var Distance_From_Intersection = 0
var Duplicates = {}
var Tree_Array = [
]
var Options = []
var BackTrack_Array = []
var Traveled = false
var Coordinate_Dict = {"Position": [0,0]}
var Detail_Dict = { "Type": "",
"Came_From": 0,
"Been_There": false}
var Preffered_Choice = {"Up": "",
"Down": "",
"Left": "",
"Right": ""}
var Cords_Minus_Curr = []
var Move_Strength = 1
var HasPrinted = false
var cmd_state = 0
var state = 0
var state2 = 0
var state3 = 0
var state4 = 0
var State = 0
var Prev_dir = ""
var Prev_dir_Opp = ""
var Result = ""
var move = 0
var move_check = 0
var ways = ["None", "Dead End", "Plain Path", "3 Way Intersection", "4 Way Intersection"]
var Printer = -1
var val = 0
var ignore = false
var Command_Size = 0
var Last_cmd
var Ordered_Commands_Forward = ["Start"]
var Ordered_Commands_Backward = []
var Individual_Steps = []
var Back_To_Start = []
var Command = []
var Couplets = []
var Was_DeadEnd_Array = []
var Tree_Intersection_Array = []
var Deleted = false
var Travel_Check = 0
var RebuildAfterDeadEnd = []
var TakeOut = 0
var SaveSize = 0
var TrackBack = []
var Been_There_Array = []
var Move_Check2 = 0
var Move_Check = 0
var CircleState = 0
var CirclingBack = false
var Temporary_Instructions = []
var move_check2 = 0
var Move_Check3 = 0
var Been_There_Overide = false
var LogDump = []
var IntersectionDump = []
var move_check3 = 0
var move_check4 = 0
var move_check5 = 0
var Move_Check6 = 0
var Move_Check7 = 0
var Cicling = false
var CircleInts = 0
var LogDumpOrdered = []
var Order = []
var Intersections_from_root = []
var TargetCord = [100,-10]
var CircleCompleted = null
var AutoBacktrack = false
var ChoiceFromInts = []
var IntersectionDict = {"Cord": [],
"Data": [] }
var IntersectionDir = []
var IntersectionMove = 0
var IntOptions = []
func _input(event):
if Current_Position != TargetCord:
if event.is_action_pressed("ui_left"):
goLeft()
Been_There()
AutoBacktrack = false
#print(Current_Position)
elif event.is_action_pressed("ui_right"):
goRight()
Been_There()
AutoBacktrack = false
#print(Current_Position)
elif event.is_action_pressed("ui_up"):
goUp()
Been_There()
AutoBacktrack = false
#print(Current_Position)
elif event.is_action_pressed("ui_down"):
goDown()
Been_There()
AutoBacktrack = false
#print(Current_Position)
elif event.is_action_pressed("ui_accept"):
AutoSolve()
#Mark(Prev_dir)
#print(LogDump)
#print(BackTrack_Array)
#print(move - BackTrack_Array[-1]+1)
pass
func _process(delta):
if Current_Position != TargetCord:
Mark(Prev_dir)
WhatMove()
BackTracking()
GiveOrder()
Intersection_Tree()
Circling()
CheckForTreeDeadEnds()
TravelLog()
DeadEndCircles()
CircleRootsAndInts()
SolvinCircleDeadEnds()
MoveAfterIntersection()
IntersectionWaysAvailable()
#BeenTheirFromPrevCord()
#print(AutoBacktrack)var IntersectionDict = {
#CircleComplete()
# CircleRootsAndInts()
#print(Cicling)
#print(LogDump)
#DeadEndMovement()
#print(Individual_Steps)
#print(Intersections_from_root)
#print(Tree_Array)
#print(Intersections)
#AutoSolve()
else:
print("We Done!!!!!!!!!!!!!!!!!!!!!!!")
func goDown():
var D = $Forwardv
dir = Vector2.DOWN
if not D.is_colliding():
self.global_position.y += 24
Current_Position[1] -=1
Prev_dir = "D"
Prev_dir_Opp = "U"
move += Move_Strength
Been_There_Overide = false
else:
Been_There_Overide = true
move += Move_Strength
print("There is something below you")
func goUp():
var U = $Backv
dir = Vector2.UP
if not U.is_colliding():
self.global_position.y -= 24
Current_Position[1] +=1
Prev_dir = "U"
Prev_dir_Opp = "D"
move += Move_Strength
Been_There_Overide = false
else:
Been_There_Overide = true
move += Move_Strength
print("There is something above you")
#BeenTheirFromPrevCord()
func goRight():
var R = $Rightv
dir = Vector2.RIGHT
if not R.is_colliding():
self.global_position.x += 24.4
Current_Position[0] +=1
Prev_dir = "R"
Prev_dir_Opp = "L"
move += Move_Strength
Been_There_Overide = false
else:
Been_There_Overide = true
move += Move_Strength
print("There is something to your right")
func goLeft():
var L = $Leftv
dir = Vector2.LEFT
if not L.is_colliding():
self.global_position.x -= 24.4
Current_Position[0] -=1
Prev_dir = "L"
Prev_dir_Opp = "R"
move += Move_Strength
Been_There_Overide = false
else:
Been_There_Overide = true
move += Move_Strength
print("There is something to your left")
func Mark(Prev_Direction):
var response = ways[IntersectionCounter()]
Detail_Dict.Type = response
Detail_Dict.Came_From = Prev_Direction
Detail_Dict.Been_There = Traveled
Detail_Dict.Move = move
Coordinate_Dict.Position = Current_Position
Coordinate_Dict.Details = Detail_Dict
var Coordinate_Dict_Copy = Coordinate_Dict.duplicate(true)
Coordinate_Dict = Coordinate_Dict_Copy
#print(Coordinate_Dict)
func WhatMove():
if Detail_Dict.Been_There == true:
if state4 != 1:
Move_Strength = 0
move = move - 1
state4 = 1
if Detail_Dict.Been_There == false:
if state4 != 2:
Move_Strength = 1
move = move + 1
state4 = 2
func TravelLog():
if Detail_Dict.Been_There == false:
if move_check3 != move:
LogDump.push_front(Prev_dir_Opp)
LogDumpOrdered.push_front(Prev_dir)
move_check3 = move
func BackTracking():
if Cicling == false:
if Detail_Dict.Type != "Plain Path" and Detail_Dict.Been_There == false:
if BackTrack_Array.find(move) == -1:
BackTrack_Array.push_back(move)
if Intersections.find(Current_Position) == -1 and Intersections.find(Current_Position) != Intersections.size() -1 and BackTrack_Array.size() >= 2:
TrackBack = GiveOrder()
Distance_From_Intersection = BackTrack_Array[-1] - BackTrack_Array[-2]
print("The distance from the last intersection is : ", Distance_From_Intersection)
print("To get to the last intersection follow these steps : ", TrackBack)
print(Individual_Steps)
if Detail_Dict.Type == "Dead End" and Current_Position != [0,0]:
GoBack(TrackBack)
pass
func Circling():
if Been_There_Array.size() > 3:
if move_check5 != move:
if Intersections.find(Current_Position) != Intersections.size()-1 and Intersections.find(Current_Position) != -1 and Been_There_Array[-2] == false and Been_There_Array[-3] == false:
var holder = []
for n in (move - BackTrack_Array[-1]):
holder.push_back(LogDump[n])
holder.push_front(Prev_dir_Opp)
print("Circling")
Cicling = true
Individual_Steps.push_front(holder)
CircleRootsAndInts()
HowManyIntsInCircle()
FirstCirclePart()
move_check5 = move
func HowManyIntsInCircle():
CircleInts = Tree_Array.size() - Intersections.find(Current_Position)+1
print(CircleInts)
func FirstCirclePart():
var count = CircleInts
if count == 0 and Current_Position == Intersections_from_root[0]:
Cicling = false
Intersection_Tree()
Ordered_Commands_Backward.clear()
print("Ignoreeeeeee")
for takeout in CircleInts + 1:
Individual_Steps.pop_front()
Tree_Array.pop_back()
print("Goin back")
print(Individual_Steps)
GoBack(Individual_Steps[0])
CircleCompleted = true
#** Returning if it needs more work or not
return false
elif count != 0 and Current_Position == Intersections_from_root[0]:
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
print("Number Of Ints: ", CircleInts)
print(Individual_Steps)
#** Returning if it needs more work or not
return true
func CircleRootsAndInts():
if Cicling == true:
if Detail_Dict.Type != "Plain Path":
if Intersections_from_root.find(Current_Position) == -1:
Intersections_from_root.push_back(Current_Position)
var Duplicate = Intersections_from_root.duplicate(true)
Intersections_from_root = Duplicate
func DeadEndCircles():
if Cicling == true:
if Detail_Dict.Type == "Dead End":
if AutoBacktrack == true:
CircleIntSubtractor()
return true
else:
return false
func SolvinCircleDeadEnds():
if CircleManualDistance() != null:
for n in CircleManualDistance():
GoBack(LogDump[n])
func CircleComplete():
if CircleCompleted == true:
if Detail_Dict.Type != "Plain Path" and Detail_Dict.Been_There == false:
Individual_Steps.push_front(GiveOrder())
print("Circle Complete")
print(Individual_Steps)
print(Tree_Array)
CircleCompleted = false
else:
pass
func CircleIntSubtractor():
CircleInts -= 1
print(CircleInts)
func Intersection_Tree():
if Cicling == false:
if Detail_Dict.Been_There == false:
if Move_Check2 != move:
if Detail_Dict.Type == "3 Way Intersection" and Current_Position != [0,0]:
Tree_Array.push_back(2)
Individual_Steps.push_front(TrackBack)
print(Tree_Array)
print(Intersections)
if Detail_Dict.Type == "4 Way Intersection" and Current_Position != [0,0]:
Tree_Array.push_back(3)
Individual_Steps.push_front(TrackBack)
print(Tree_Array)
print(Intersections)
if Detail_Dict.Type == "Dead End" and Current_Position != [0,0]:
Tree_Array[-1] -= 1
print(Tree_Array)
print(Intersections)
Move_Check2 = move
func CheckForTreeDeadEnds():
if Tree_Array.size() > 0:
if Tree_Array[-1] <= 0:
Tree_Array.pop_back()
Tree_Array[-1] -= 1
print(Tree_Array)
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
else:
pass
func CircleManualDistance():
if DeadEndCircles() == true and Intersections_from_root.size() >= 2:
var Starting_Pos = Intersections_from_root[-2]
var Ending_Pos = Intersections_from_root[-1]
var x = abs(Starting_Pos[0] - Ending_Pos[0])
var y = abs(Starting_Pos[1] - Ending_Pos[1])
return x+y
func GiveOrder():
Ordered_Commands_Backward.erase("")
if move_check != move:
TrackIntersections()
if Detail_Dict.Been_There == false:
Ordered_Commands_Backward.push_back(Prev_dir_Opp)
if Detail_Dict.Type != "Plain Path":
TakeOut = (Cords.size() - Cords.find(Intersections[-2]))
var test = Ordered_Commands_Backward.slice(0 , TakeOut)
test.reverse()
Ordered_Commands_Backward.clear()
return test
move_check = move
func TrackIntersections():
if Intersections.find(Current_Position) == -1:
if Detail_Dict.Type != "Plain Path" and Detail_Dict.Type != "Dead End":
Intersections.push_back(Current_Position)
Intersections_Copy = Intersections.duplicate(true)
Intersections = Intersections_Copy
IntersectionMove = move
func MoveAfterIntersection():
if move == IntersectionMove+1:
if Move_Check6 != move:
if TrackBack.size() != 1:
IntersectionDir.push_back(LogDumpOrdered[0])
else:
IntersectionDir.push_back(LogDump[0])
print(Intersections)
print(IntersectionDir)
Move_Check6 = move
func IntersectionWaysAvailable():
var R: bool = $Rightv.is_colliding()
var L: bool = $Leftv.is_colliding()
var D: bool = $Forwardv.is_colliding()
var U: bool = $Backv.is_colliding()
var Sender = []
var Colliders = [R,L,U,D]
var DirArray = ["R","L","U","D"]
if Move_Check7 != move and Detail_Dict.Type != "Plain Path" and Detail_Dict.Type != "Dead End" and Detail_Dict.Been_There == false:# and Intersections.find(Current_Position) == -1:
for n in Colliders.size():
if Colliders[n] == false:
Sender.push_back(DirArray[n])
IntOptions.push_back(Sender)
print(IntOptions)
if Move_Check7 != move and Detail_Dict.Type != "Plain Path" and Detail_Dict.Type != "Dead End" and Detail_Dict.Been_There == true:
print(IntOptions)
Move_Check7 = move
func BackToStart():
if Detail_Dict.Type == "Plain Path":
Individual_Steps.push_front(Ordered_Commands_Backward)
func Been_There():
if Been_There_Overide == false:
if Cords.find(Current_Position) == -1:
Cords.push_back(Current_Position)
Cords_Copy = Cords.duplicate(true)
Cords = Cords_Copy
Traveled = false
else:
Traveled = true
Been_There_Array.push_back(Traveled)
func recall():
print(Individual_Steps)
for Sections in Individual_Steps:
#print(Sections)
for Section in Sections:
#Move(Section)
pass
func GoBack(Set):
AutoBacktrack = true
for n in Set:
Move(n)
func IntersectionCounter():
var R: bool = $Rightv.is_colliding()
var L: bool = $Leftv.is_colliding()
var D: bool = $Forwardv.is_colliding()
var U: bool = $Backv.is_colliding()
var WaysToGo = 0
var Directions = [R,L,D,U]
for Direction in Directions:
if Direction == false:
WaysToGo += 1
if Direction == true:
pass
return WaysToGo
func Move(SetDirection):
if SetDirection == "R":
self.global_position.x += 24.4
Current_Position[0] +=1
Prev_dir = "R"
Prev_dir_Opp = "L"
move += Move_Strength
Been_There()
if SetDirection == "L":
self.global_position.x -= 24.4
Current_Position[0] -=1
Prev_dir = "L"
Prev_dir_Opp = "R"
move += Move_Strength
Been_There()
if SetDirection == "D":
self.global_position.y += 24
Current_Position[1] -=1
Prev_dir = "D"
Prev_dir_Opp = "U"
move += Move_Strength
Been_There()
if SetDirection == "U":
self.global_position.y -= 24
Current_Position[1] +=1
Prev_dir = "U"
Prev_dir_Opp = "D"
move += Move_Strength
Been_There()
#print(Current_Position)
func AutoSolve():
var R: bool = $Rightv.is_colliding()
var L: bool = $Leftv.is_colliding()
var D: bool = $Forwardv.is_colliding()
var U: bool = $Backv.is_colliding()
var DirectionStrengths = [6,6,5,6]
var Colliders = [R,L,U,D]
var DirArray = ["R","L","U","D"]
var DumpDuplicate = LogDump
var cp = Current_Position
var OptionArrays = [[cp[0],cp[1]+1],[cp[0],cp[1]-1],[cp[0]+1,cp[1]],[cp[0]-1,cp[1]]]
for n in DirectionStrengths.size():
var MoveScore = DumpDuplicate.rfind(DirArray[n])
if Colliders[n] == true:
DirectionStrengths[n] -= 1000
if DirArray.find(Prev_dir_Opp) == n:
DirectionStrengths[n] -= 50
if Individual_Steps.size() < 1 and Ordered_Commands_Backward.size() > 1:
if Ordered_Commands_Backward[0] == DirArray[n]:
DirectionStrengths[n] -= 25
elif Individual_Steps.size() >= 1:
var Wayback = Individual_Steps[0]
if Wayback[0] == DirArray[n]:
DirectionStrengths[n] -= 25
if MoveScore < 15:
DirectionStrengths[n] -= MoveScore
for i in OptionArrays:
if Intersections.find(i) != -1:
DirectionStrengths[n] -= 100
AutoBacktrack = false
var HighestPoints = DirectionStrengths.find(max(DirectionStrengths[0],DirectionStrengths[1],DirectionStrengths[2],DirectionStrengths[3]))
#print(DirArray[HighestPoints])
Move(DirArray[HighestPoints])
#print(DirectionStrengths)
#print(DirArray)
#print(Individual_Steps)

View File

@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf

2
Project_Forum_From_Home/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

View File

@@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z" fill="#478cbf"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 949 B

View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dmy7a1rfp2p1v"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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

View File

@@ -0,0 +1,20 @@
; 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="Project_Forum_From_Home"
config/features=PackedStringArray("4.2", "GL Compatibility")
config/icon="res://icon.svg"
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

20
Rightv.gd Normal file
View File

@@ -0,0 +1,20 @@
extends RayCast2D
# 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):
if is_colliding():
#print("True")
var right: bool = true
else:
#print("False")
var right: bool = false

BIN
Terrain (16x16).png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dtx8kr48cia6x"
path="res://.godot/imported/Terrain (16x16).png-f072e8a5f99e915c05031c83401c87a9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Terrain (16x16).png"
dest_files=["res://.godot/imported/Terrain (16x16).png-f072e8a5f99e915c05031c83401c87a9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

1
icon.svg Normal file
View File

@@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="124" height="124" rx="14" fill="#363d52" stroke="#212532" stroke-width="4"/><g transform="scale(.101) translate(122 122)"><g fill="#fff"><path d="M105 673v33q407 354 814 0v-33z"/><path d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z" fill="#478cbf"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></g></svg>

After

Width:  |  Height:  |  Size: 949 B

37
icon.svg.import Normal file
View File

@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bpuvmnj2uuavs"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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

240
main.tscn Normal file

File diff suppressed because one or more lines are too long

21
project.godot Normal file
View File

@@ -0,0 +1,21 @@
; 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="Project Forum Sim"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
[rendering]
renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"

28
scenes/MC.gd Normal file
View File

@@ -0,0 +1,28 @@
extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity = ProjectSettings.get_setting("physics/2d/default_gravity")
func _physics_process(delta):
# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta
# Handle jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction = Input.get_axis("ui_left", "ui_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
move_and_slide()

18
scenes/MC.tscn Normal file
View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://bcuo3byxygxyi"]
[ext_resource type="Texture2D" uid="uid://q4fvqt4hhr86" path="res://Jump (32x32).png" id="1_ul47s"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yoddx"]
size = Vector2(33, 52)
[node name="CharacterBody2D" type="CharacterBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(49.5, 593.5)
scale = Vector2(1.46875, 1.90625)
texture = ExtResource("1_ul47s")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(48.5, 597)
shape = SubResource("RectangleShape2D_yoddx")