Skip to content

Commit

Permalink
more textures
Browse files Browse the repository at this point in the history
  • Loading branch information
HungerGames682 committed Dec 16, 2022
1 parent 8c955dd commit 0a14edb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
sc = turtle.Screen()

# All of this is addign custom skins into the game, i will have to make them tho
shape_list = ['Door_lr.gif','Door.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']
shape_list = ['Mossy_brick.gif','Door_lr.gif','Door_ud.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 = []
for kjh in range(len(shape_list)):
hehe = shape_list[kjh]
Expand All @@ -60,6 +60,8 @@
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]
Expand Down Expand Up @@ -128,7 +130,7 @@ def statline2(how_obj,stop,statcolor,statyline,buildspeed):
# line[how_obj] = turtle.Turtle()
# line[how_obj].speed(buildspeed)
balls = turtle.Turtle()
object(stat_line_skin,statcolor,player, balls,0,statyline,stop,stat_line_skin,1,1)
object(stat_line_skin,statcolor,player, balls,0,statyline,stop,stat_line_skin)

# Decides if the closest object if you can walkthrough it or not
def walkthrough_list(dis,walkthrough):
Expand Down Expand Up @@ -259,34 +261,33 @@ def filter_closest_objects(close1,close2,close3):
# Adds texture to blocks
def add_textures(texture):
if texture != 0:
size_x = 1
size_y = 1

if texture == "Chest":
texture = base_chest_skin
size_x = 1
size_y = 1


elif texture == "Door_ud":
texture = base_door_skin
size_x = 1
size_y = 1


elif texture == "Door_lr":
texture = base_lr_door_skin
size_x = 1
size_y = 1


elif texture == "Wall":
texture = mossy_wall_skin



else:
texture_error = "null"
size_x = 1
size_y = 1
return texture_error,size_x,size_y

return texture_error

return texture,size_x,size_y
return texture

else:
print("No texture for type " + str(texture))
return "null",1,1
return "null"



Expand Down Expand Up @@ -336,19 +337,18 @@ def obj_create(stop,buildspeed,many):
texture = ctype
else:
texture = 0
size_x = 1
size_y = 1







texture,size_x,size_y = add_textures(texture)
print(size_x,size_y)
texture = add_textures(texture)


# Actully creats the object and the saves it to see if has colliotion or not(Clearly)
has_colition = object("square",color,coli, line[which],newx,newy,stop,texture,size_x,size_y)
has_colition = object("square",color,coli, line[which],newx,newy,stop,texture)
print(has_colition)
name_list.append(line[which])
# Sees if the object can be walked through or not
Expand Down Expand Up @@ -448,6 +448,7 @@ def level_switch(stop,buildspeed,level):
texture = ctype
else:
texture = 0




Expand Down Expand Up @@ -887,14 +888,14 @@ def playermove(speed,movement,walkthrough, offset, stop,li,cur_health,level,pick


# Object creator
def object(shape,coler,colition,name,x,y, stop,texture,size_x,size_y):
def object(shape,coler,colition,name,x,y, stop,texture):


name.penup()
if game_quality == 1:
name.color(str(coler))
name.shape(str(shape))
name.shapesize(int(size_x),int(size_y))


elif texture == "null":
name.shape(null_skin)
Expand All @@ -903,14 +904,8 @@ def object(shape,coler,colition,name,x,y, stop,texture,size_x,size_y):


elif texture != "null":
if size_x == 1 and size_y == 1:
name.shape(texture)
elif size_x > 1 or size_y > 1:
name.shapesize(int(size_x),int(size_y))
name.shape(texture)

else:
error("Invaled size error",1)
name.shape(texture)


elif size_x == 1 and size_y == 1:
name.shape(texture)
Expand Down
Binary file removed sprits/Door.gif
Binary file not shown.
Binary file modified sprits/Door_lr.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprits/Door_ud.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sprits/Mossy_brick.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified sprits/null.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0a14edb

Please sign in to comment.