cellsim 1.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cellsim-1.0 → cellsim-1.0.0}/LICENSE +4 -2
- {cellsim-1.0/src/cellsim.egg-info → cellsim-1.0.0}/PKG-INFO +22 -19
- cellsim-1.0.0/README.md +8 -0
- {cellsim-1.0 → cellsim-1.0.0}/pyproject.toml +5 -2
- cellsim-1.0.0/src/cellsim/__init__.py +1 -0
- {cellsim-1.0 → cellsim-1.0.0}/src/cellsim/pac.py +0 -69
- cellsim-1.0/README.md +0 -5
- cellsim-1.0/setup.cfg +0 -4
- cellsim-1.0/src/cellsim/__init__.py +0 -0
- {cellsim-1.0 → cellsim-1.0.0/src/cellsim.egg-info}/PKG-INFO +0 -0
- {cellsim-1.0 → cellsim-1.0.0}/src/cellsim.egg-info/SOURCES.txt +0 -0
- {cellsim-1.0 → cellsim-1.0.0}/src/cellsim.egg-info/dependency_links.txt +0 -0
- {cellsim-1.0 → cellsim-1.0.0}/src/cellsim.egg-info/top_level.txt +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Sam Fertig
|
|
2
4
|
|
|
3
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -16,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
16
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name: cellsim
|
|
3
|
-
Version: 1.0
|
|
4
|
-
Summary:
|
|
5
|
-
|
|
6
|
-
Project-URL:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: cellsim
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: With this new releace I have updates the LICENCE and the README file.
|
|
5
|
+
Project-URL: Homepage, https://github.com/pypa/sampleproject
|
|
6
|
+
Project-URL: Issues, https://github.com/pypa/sampleproject/issues
|
|
7
|
+
Author-email: Sam Fertig <sfertig007@gmail.com>
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
Welcome, this is a overveiw of the holhe system with each update marked:
|
|
16
|
+
|
|
17
|
+
System overveiw:
|
|
18
|
+
|
|
19
|
+
sellsim.CellOut()
|
|
20
|
+
---this function will take you to the main class of the hold module. You will then need to run the 'init', and 'run' functions and the simulation will start.
|
|
21
|
+
|
|
22
|
+
|
cellsim-1.0.0/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Welcome, this is a overveiw of the holhe system with each update marked:
|
|
2
|
+
|
|
3
|
+
System overveiw:
|
|
4
|
+
|
|
5
|
+
sellsim.CellOut()
|
|
6
|
+
---this function will take you to the main class of the hold module. You will then need to run the 'init', and 'run' functions and the simulation will start.
|
|
7
|
+
|
|
8
|
+
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
1
4
|
[project]
|
|
2
5
|
name = "cellsim"
|
|
3
|
-
version = "1.0"
|
|
6
|
+
version = "1.0.0"
|
|
4
7
|
authors = [
|
|
5
8
|
{ name="Sam Fertig", email="sfertig007@gmail.com" },
|
|
6
9
|
]
|
|
7
|
-
description = "
|
|
10
|
+
description = "With this new releace I have updates the LICENCE and the README file."
|
|
8
11
|
readme = "README.md"
|
|
9
12
|
requires-python = ">=3.8"
|
|
10
13
|
classifiers = [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from pac import CellOut
|
|
@@ -16,10 +16,7 @@ class GameWindow:
|
|
|
16
16
|
pygame.display.set_caption("Application")
|
|
17
17
|
self.objects = {}
|
|
18
18
|
self.objcolor = {}
|
|
19
|
-
self.images = {}
|
|
20
|
-
self.image_pos = {}
|
|
21
19
|
self.text = None
|
|
22
|
-
self.file_operations = self.FileOperations()
|
|
23
20
|
|
|
24
21
|
def screen(self):
|
|
25
22
|
self.WIN.fill(self.color)
|
|
@@ -35,52 +32,6 @@ class GameWindow:
|
|
|
35
32
|
self.objects[name] = pygame.Rect(x, y, width, height)
|
|
36
33
|
self.objcolor[name + ' color'] = color
|
|
37
34
|
|
|
38
|
-
def key_move(self, name: str, speed: int):
|
|
39
|
-
keys = pygame.key.get_pressed()
|
|
40
|
-
if keys[pygame.K_LEFT] or keys[pygame.K_a]:
|
|
41
|
-
self.objects[name].x -= speed
|
|
42
|
-
if keys[pygame.K_RIGHT] or keys[pygame.K_d]:
|
|
43
|
-
self.objects[name].x += speed
|
|
44
|
-
if keys[pygame.K_UP] or keys[pygame.K_w]:
|
|
45
|
-
self.objects[name].y -= speed
|
|
46
|
-
if keys[pygame.K_DOWN] or keys[pygame.K_s]:
|
|
47
|
-
self.objects[name].y += speed
|
|
48
|
-
|
|
49
|
-
def move(self, name: str, x: int, y: int):
|
|
50
|
-
self.objects[name].x = x
|
|
51
|
-
self.objects[name].y = y
|
|
52
|
-
|
|
53
|
-
def create_image(self, name: str, image_file: str, x: int, y: int):
|
|
54
|
-
self.images[name] = pygame.image.load(image_file)
|
|
55
|
-
self.image_pos[name + ' pos'] = (x, y)
|
|
56
|
-
|
|
57
|
-
def collide(self, object1: str, object2: str) -> bool:
|
|
58
|
-
return pygame.Rect.colliderect(self.objects[object1], self.objects[object2])
|
|
59
|
-
|
|
60
|
-
def position(self, object: str) -> tuple:
|
|
61
|
-
return self.objects[object].x, self.objects[object].y
|
|
62
|
-
|
|
63
|
-
def mouse_X(self) -> int:
|
|
64
|
-
return pygame.mouse.get_pos()[0]
|
|
65
|
-
|
|
66
|
-
def mouse_Y(self) -> int:
|
|
67
|
-
return pygame.mouse.get_pos()[1]
|
|
68
|
-
|
|
69
|
-
def mouse_pos(self) -> tuple:
|
|
70
|
-
return pygame.mouse.get_pos()
|
|
71
|
-
|
|
72
|
-
def image_position(self, name: str) -> tuple:
|
|
73
|
-
return self.image_pos[name + ' pos']
|
|
74
|
-
|
|
75
|
-
def click(self) -> bool:
|
|
76
|
-
for event in pygame.event.get():
|
|
77
|
-
if event.type == pygame.MOUSEBUTTONDOWN:
|
|
78
|
-
return True
|
|
79
|
-
return False
|
|
80
|
-
|
|
81
|
-
def remove_object(self, name: str):
|
|
82
|
-
del self.objects[name]
|
|
83
|
-
del self.objcolor[name + ' color']
|
|
84
35
|
|
|
85
36
|
def clear_objects(self, key: str):
|
|
86
37
|
if key == "YES":
|
|
@@ -98,24 +49,6 @@ class GameWindow:
|
|
|
98
49
|
def pressed_keys(self):
|
|
99
50
|
return pygame.key.get_pressed()
|
|
100
51
|
|
|
101
|
-
class FileOperations:
|
|
102
|
-
def read(self, file_name: str) -> list:
|
|
103
|
-
try:
|
|
104
|
-
with open(file_name, 'r') as file:
|
|
105
|
-
return [line.strip() for line in file.readlines()]
|
|
106
|
-
except FileNotFoundError:
|
|
107
|
-
print(f"File {file_name} not found.")
|
|
108
|
-
return []
|
|
109
|
-
|
|
110
|
-
def write(self, file_name: str, text: str):
|
|
111
|
-
with open(file_name, 'w') as file:
|
|
112
|
-
file.write(text)
|
|
113
|
-
|
|
114
|
-
def append(self, file_name: str, text: str):
|
|
115
|
-
with open(file_name, 'a') as file:
|
|
116
|
-
file.write(text)
|
|
117
|
-
|
|
118
|
-
|
|
119
52
|
class CellOut:
|
|
120
53
|
def __init__(self, width: int, height: int, size: int, starting_pop: int, colors=None, fps=10):
|
|
121
54
|
self.width = width
|
|
@@ -323,5 +256,3 @@ class CellOut:
|
|
|
323
256
|
return new_x, new_y
|
|
324
257
|
else:
|
|
325
258
|
return position
|
|
326
|
-
|
|
327
|
-
|
cellsim-1.0/README.md
DELETED
cellsim-1.0/setup.cfg
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|