This commit is contained in:
Benjamín 2021-09-10 21:08:42 +02:00
parent 95fc749c6c
commit d715ffb7ef
10 changed files with 60 additions and 19 deletions

@ -22,12 +22,11 @@ class Multiscene(Scene):
subscene.subscene_size = subscene.screen_size subscene.subscene_size = subscene.screen_size
subscene.resize_screen(self.to_ints((self.matrix @ subscene.subscene_size).tolist()), True) subscene.resize_screen(self.to_ints((self.matrix @ subscene.subscene_size).tolist()), True)
self.s = pygame.display.set_mode(self.screen_size)
self.subscenes_prepared = True self.subscenes_prepared = True
def light_update(self): def light_update(self):
for subscene in self.subscenes:
subscene.light_update()
for object_ in self.l_objects: for object_ in self.l_objects:
object_.update() object_.update()
object_.blit() object_.blit()

@ -1,5 +1,5 @@
from UI.Objects.Multiscene import Multiscene from UI.Objects.Multiscene import Multiscene
from UI.Scenes.BasicScene import BasicScene from UI.Scenes.Sample_Scenes.BasicScene import BasicScene
from numpy import array as a from numpy import array as a
from UI.Objects.nr_objects.Line import Line from UI.Objects.nr_objects.Line import Line

@ -0,0 +1,43 @@
from UI.Objects.Multiscene import Multiscene
from UI.Objects.nr_objects.light_objects.LuminousCircleEffect import LuminousCircleEffect
from UI.Scenes.Sample_Scenes.LuminousCircleEffectScene import LuminousCircleEffectScene
from numpy import array as a
from UI.Objects.nr_objects.Line import Line
class LuminousCircleEffectMultiscene(Multiscene):
def __init__(self, scene_size):
self.s__size = [600, 400]
super().__init__(self.s__size[0], self.s__size[1], scene_size)
s0 = LuminousCircleEffectScene([200, 400])
s1 = LuminousCircleEffectScene([400, 400])
s1.position = a([200, 0])
l0 = Line(a([200, 0]), a([200, 400]), 10, (255, 100, 100), self)
lce0 = LuminousCircleEffect(a([200, 320]), 60, (255, 100, 100), self)
self.sort_objects(s0, s1, l0, lce0)
self.i = 0
def progress(self):
if self.i == 1:
self.subscenes[0].subscene_size[0] += 1
self.subscenes[1].subscene_size[0] -= 1
self.subscenes[1].position[0] += 1
self.nr_objects[0].a[0] += 1
self.nr_objects[0].b[0] += 1
self.l_objects[0].position[0] += 1
self.resize_subscenes()
self.i = 0
else:
self.i += 1

@ -11,6 +11,6 @@ class LuminousCircleEffectScene(Scene):
super().__init__(*s__size, screen_size, bg) super().__init__(*s__size, screen_size, bg)
ce0 = LuminousCircleEffect(a([300, 200]), 100, (80, 120, 80), self, circles_n=600) lce0 = LuminousCircleEffect(a([300, 200]), 100, (80, 120, 80), self, circles_n=60)
self.sort_objects(ce0) self.sort_objects(lce0)

@ -1,5 +1,5 @@
from UI.Objects.Multiscene import Multiscene from UI.Objects.Multiscene import Multiscene
from UI.Scenes.BasicMultiscene import BasicMultiscene from UI.Scenes.Sample_Scenes.BasicMultiscene import BasicMultiscene
from numpy import array as a from numpy import array as a
from UI.Objects.nr_objects.Line import Line from UI.Objects.nr_objects.Line import Line

@ -2,7 +2,7 @@ from numpy import array as a
from UI.Objects.Multiscene import Multiscene from UI.Objects.Multiscene import Multiscene
from UI.Objects.nr_objects.Line import Line from UI.Objects.nr_objects.Line import Line
from UI.Scenes.RopeScene import RopeScene from UI.Scenes.Sample_Scenes.RopeScene import RopeScene
class RopeMultiscene(Multiscene): class RopeMultiscene(Multiscene):

@ -1,17 +1,18 @@
from numpy import array as a from numpy import array as a
import time import time
from UI.Scenes.LuminousCircleEffectScene import LuminousCircleEffectScene
from UI.Scenes.Sample_Scenes.LuminousCircleEffectMultiscene import LuminousCircleEffectMultiscene
from UI.Scenes.Sample_Scenes.LuminousCircleEffectScene import LuminousCircleEffectScene
screen_size = a([1000, 800]) screen_size = a([1000, 800])
scene = LuminousCircleEffectScene(screen_size) scene = LuminousCircleEffectMultiscene(screen_size)
scene.update() scene.update()
for i in range(400): for i in range(400):
scene.update() scene.light_update()
scene.save(f"Render/{i}.png", screen_size)
time.sleep(0.05) time.sleep(0.05)

@ -1,17 +1,15 @@
import pygame.mouse import pygame.mouse
from UI.Scenes.BasicScene import BasicScene from UI.Scenes.Sample_Scenes.BasicMultiscene import BasicMultiscene
from UI.Scenes.BasicMultiscene import BasicMultiscene from UI.Scenes.Sample_Scenes.BasicScene import BasicScene
from UI.Scenes.MultisceneInMultiscene import MultisceneInMultiscene from UI.Scenes.Sample_Scenes.LuminousCircleEffectMultiscene import LuminousCircleEffectMultiscene
from UI.Scenes.RopeScene import RopeScene from UI.Scenes.Sample_Scenes.LuminousCircleEffectScene import LuminousCircleEffectScene
from UI.Scenes.RopeMultiscene import RopeMultiscene
from UI.Scenes.LuminousCircleEffectScene import LuminousCircleEffectScene
from numpy import array as a from numpy import array as a
import time import time
screen_size = a([200, 500]) screen_size = a([200, 500])
scene = LuminousCircleEffectScene(screen_size) scene = LuminousCircleEffectMultiscene(screen_size)
mouse_pos = [0, 0] mouse_pos = [0, 0]
clicked = False clicked = False