Hi, I am very new at this. I am trying to get a sunset background, preferably using a HSB with dwindling value of the brightness.
I have tried just importing time using Range and Sleep which of course didn't work.
I tried with the code below to at least transition with delay from one color to another but can't seam to figure it out delay. Surely there is a simple way to create sunset where I get blue background to transition to black while leaving a Sprite alien to watch it.
Please help. I learn best from examples. I believe I am supposed to use action delay but would really appreciate if someone could show me an example of code that transitions color in the background so I can understand it better. Thanks in advance.
from scene import *
import time
class FirstScene(Scene):
def setup(self):
self.start_time = time.time()
SpriteNode(anchor_point=(0, 0), color='white', parent=self,
size=self.size)
def update(self):
newColor = ['blue','green']
if not self.presented_scene and time.time() - self.start_time > 2:
SpriteNode(anchor_point=(0, 0), color= newColor[0], parent=self,
size=self.size)
self.start_time = time.time()
if not self.presented_scene and time.time() - self.start_time > 2:
SpriteNode(anchor_point=(0, 0), color= newColor[1], parent=self,
size=self.size)
main_view = SceneView()
main_view.scene = FirstScene()
main_view.present(hide_title_bar=True, animated=False)