Skip to content

Commit

Permalink
ahhh, textures stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
HungerGames682 committed Dec 16, 2022
1 parent 0a14edb commit 75dd721
Show file tree
Hide file tree
Showing 19 changed files with 351 additions and 468 deletions.
117 changes: 111 additions & 6 deletions Level_builderv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,54 @@
lock_difficulty_list = []
item_list = []
chest_list = []

sc = turtle.Screen()
shape_list = ['Mossy_brick.gif','Door_lrt.gif','Door_udt.gif','null.gif','base_chest.gif','bottom_pick.gif','pins.gif','stats_line.gif','heart.gif','Inventory Frame.gif','Lock Pick.gif','Selected Inventory Frame.gif']
edit_shape_list = []
base_names_list = []
for kjh in range(len(shape_list)):
hehe = shape_list[kjh]
ddd = hehe.replace(".gif","")
base_names_list.append(ddd)
hehe = './sprits/' + hehe
edit_shape_list.append(hehe)
sc.register_shape(hehe)

skin = 0


# Defines all of the skins here
mossy_wall_skin = edit_shape_list[skin]
skin = skin + 1
base_lr_door_skin = edit_shape_list[skin]
skin = skin + 1
base_door_skin = edit_shape_list[skin]
skin = skin + 1
null_skin = edit_shape_list[skin]
skin = skin + 1
base_chest_skin = edit_shape_list[skin]
skin = skin + 1
bottem_lock_pick = edit_shape_list[skin]
skin = skin + 1
pins_skin = edit_shape_list[skin]
skin = skin + 1
stat_line_skin = edit_shape_list[skin]
skin = skin + 1
heart_skin = edit_shape_list[skin]
skin = skin + 1
inventory_frame_skin = edit_shape_list[skin]
skin = skin + 1
lcok_pick_item_skin = edit_shape_list[skin]
skin = skin + 1
selected_inventory_frame_skin = edit_shape_list[skin]
skin = skin + 1







# Draws the statline
def statline2(how_obj,stop,statcolor,statyline,buildspeed):
for he in range(-500,500,20):
Expand Down Expand Up @@ -396,10 +444,10 @@ def lockswitch(lock_difficulty):

# Displays which way the door should open
def door_switch(door_open):
if door_open == "lr":
door_open = "ud"
elif door_open == "ud":
door_open = "lr"
if door_open == "lrt":
door_open = "udt"
elif door_open == "udt":
door_open = "lrt"

dooricon.clear()
dooricon.write("Door status is " + door_open)
Expand Down Expand Up @@ -557,6 +605,32 @@ def load_level(level):
print(chest_list)


# Lets you switch your texture
def texture_switch(ud,texture,value):
stop = len(base_names_list) - 1
if ud == "t" and value != stop:
value = value + 1

texture = base_names_list[value]

elif ud == "g" and value !=0:
value = value -1
texture = base_names_list[value]

elif value == 0 and ud == "g":
value = stop
texture = base_names_list[value]

elif value == stop and ud == "t":
value = 0
texture = base_names_list[value]




return texture,value





Expand Down Expand Up @@ -608,6 +682,7 @@ def load_level(level):
typeicon.hideturtle()
typeicon.goto(-200,-225)
typeicon.write("Type is Chest")
new_type = "Null"

# Chest attribute icon
chest = turtle.Turtle()
Expand Down Expand Up @@ -635,8 +710,17 @@ def load_level(level):
dooricon.hideturtle()
dooricon.goto(-100,-225)
dooricon.write("")
door_open = "lr"
door_open = "lrt"

# Texture icon
textureicon = turtle.Turtle()
textureicon.speed(0)
textureicon.penup()
textureicon.hideturtle()
textureicon.goto(-100,-250)
textureicon.write("Texture = null")
texture = "null"
value = 0



Expand Down Expand Up @@ -685,7 +769,19 @@ def load_level(level):
if keyboard.is_pressed("v") and type == "Door":
door_open = door_switch(door_open)

# Switches the texture
if keyboard.is_pressed("t"):
texture,value = texture_switch("t",texture,value)
builder.shape(edit_shape_list[value])
sleep(.2)

elif keyboard.is_pressed("g"):
texture,value = texture_switch("g",texture,value)
builder.shape(edit_shape_list[value])
sleep(.2)




# Enables erease mode
if keyboard.is_pressed("e"):
Expand All @@ -698,15 +794,24 @@ def load_level(level):
# Switches the type of object
elif keyboard.is_pressed("r"):
type,cur_item = typeswitch(type,cur_item)

chest.clear()
print(type)

sleep(.2)




else:
speed = 20
start(speed,curcolor,collition,damage,type,lock_difficulty)
start(speed,curcolor,collition,damage,new_type,lock_difficulty)
sleep(.05)
if type == "Spawn":
print("Spq")
new_type = type
else:
new_type = type + "_" + str(texture)
print(new_type,texture)


15 changes: 5 additions & 10 deletions chest_give.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Door
Wall
Wall
Wall
Expand All @@ -10,14 +11,6 @@ Wall
Wall
Wall
Wall
Door
Door
Door
Door
Door
Door
Wall
Wall
Wall
Wall
Wall
Expand All @@ -27,7 +20,9 @@ Wall
Wall
Wall
Wall
Chest
Spawn
Door
Door
Door
Door
Spawn
lockpick
7 changes: 1 addition & 6 deletions colli.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@
1
1
1
0
1
1
1
1
1
1
1
1
0
1
37 changes: 16 additions & 21 deletions color.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,19 @@ black
black
black
black
red
red
red
red
red
red
blue
blue
blue
blue
blue
blue
blue
blue
blue
blue
blue
yellow
yellow
yellow
blue
black
black
black
black
black
black
black
black
black
black
black
black
black
black
black
black
96 changes: 43 additions & 53 deletions cords.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,56 @@
-180
160
-180
140
-180
120
-180
100
-180
80
-180
60
-180
40
-180
-20
-180
-40
-180
-60
-180
-80
-180
-100
-180
20
-180
0
-40
160
140
-20
160
140
0
140
20
140
40
140
60
140
60
140
-40
140
-100
140
-120
-20
-120
140
-140
140
-160
140
-180
140
-200
140
-200
140
-80
140
100
140
120
100
100
100
140
140
140
160
140
160
140
80
80
100
60
100
40
100
20
100
-120
80
0
100
-100
-120
100
-100
100
-80
100
-160
0
-60
-60
100
-40
100
-20
-40
20
40
80
9 changes: 2 additions & 7 deletions damage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,5 @@
0
0
0
0
0
0
0
0
0
0
1
1
Loading

0 comments on commit 75dd721

Please sign in to comment.