added Create Objects By String

main
Justus Jan Nico Wolff 2024-05-15 20:22:08 +02:00
parent f540626b4b
commit 769c9067d2
2 changed files with 20 additions and 1 deletions

2
clang
View File

@ -1 +1 @@
en_EN
de_DE

View File

@ -195,6 +195,25 @@ class camera(obj):
if self.mode == cammode.follow and self.subject:
self.position = self.subject.position
def COBS(target: str, offset=vector2(), ignore=[" ",]):
target = target.split("\n")
out = []
for i in range(len(target)):
y = i
i = target[i]
for f in range(len(i)):
x = f
f = i[x]
if f in ignore:
continue
temp = obj()
temp.char = f
temp.position = vector2(x, y)+offset
temp.anchored = True
temp.collide = True
out.append(temp)
return out
class game:
def __init__(self, size=[10, 10], renderer=stdrend, sounddir=""):
if renderer == None: raise TypeError("Renderer class needed!")