Stumbled upon a very interesting documentary. Gives a nice account
of what life might have been like in the Bronze Age.
Stumbled upon a very interesting documentary. Gives a nice account
of what life might have been like in the Bronze Age.
Trying different looks for my vid. Here, with the Champlain
bridge as background. One uses the blit() function to show the image.
My - currently - bare bones video in Clipchamp:
https://clipchamp.com/watch/vlsDDGwyrMd
The fireworks code:
https://github.com/LytixDev/pygame_fireworks/blob/master/fireworks.py
The Dubstep:
After many trials, managed to wire my character. Next lesson will
be a walk cycle. (There are other tutorials with less realistic characters;
if this proves impossible...)
import pygame
import random
# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 500
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption('Codemy.com - Aspen Classes')
clock = pygame.time.Clock()
running = True
dt = 0
player_pos = pygame.Vector2(screen.get_width() / 2, screen.get_height() / 2)
# Define a Game Class
class Game():
def __init__(self, aspen_group, food_group):
self.aspen_group = aspen_group
self.food_group = food_group
def update(self):
self.check_collisions()
def check_collisions(self):
if pygame.sprite.groupcollide(self.aspen_group, self.food_group, False, True):
print(len(self.food_group))
# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/aspen2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = 5
# Add food group to aspen class
# self.food_group = food_group
def update(self):
self.move()
# self.check_collisions()
def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT]:
self.rect.x += self.velocity
if keys[pygame.K_UP]:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN]:
self.rect.y += self.velocity
# def check_collisions(self):
# if pygame.sprite.spritecollide(self, self.food_group, True):
# print(len(self.food_group))
# Define an Food Class
class Food(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/food2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 2)
def update(self):
self.rect.y += self.velocity
# Create an food group
food_group = pygame.sprite.Group()
# Create 5 aspens
for i in range(8):
food = Food(i * 100, 10)
food_group.add(food)
# Create aspen group
aspen_group = pygame.sprite.Group()
# Create and position aspen
aspen = Aspen(200, 400)
# Add aspen to the group
aspen_group.add(aspen)
# Create Game Object
our_game = Game(aspen_group, food_group)
while running:
# poll for events
# pygame.QUIT event means that the user clicked the X to close the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# Pick the screen color
screen.fill("silver")
# Blit (copy) screen object at a given coordinates
# screen.blit(aspen, aspen_rect)
# Draw and Move Food and Aspen sprite
food_group.update()
food_group.draw(screen)
aspen_group.update()
aspen_group.draw(screen)
# Update Game Instance
our_game.update()
# flip the display to output our work to the screen
pygame.display.flip()
# Set the clock stuff / delta time in seconds since the last frame
# used for framerate independent physics
dt = clock.tick(60) / 1000
pygame.quit()
source: La Presse, AGENCE FRANCE-PRESSE
translation: BingTranslate/doxa-louise
A charismatic anti-corruption activist and Vladimir Putin's number one enemy, Alexei Navalny, 47, is serving a 19-year prison sentence for "extremism".
(Moscow) Imprisoned Russian opposition leader Alexei Navalny, whose fate is worrying in the West, said on Tuesday that he was "fine" after a long and "tiring" transfer to a remote Arctic penal colony.
His relatives, who had not heard from him for nearly three weeks, announced on Monday that they had found him in a penal colony in Kharp, located in Yamalo-Nenetsia, beyond the Arctic Circle.
They say the Russian authorities are seeking to isolate him even further, three months before the March 2024 presidential election in which Vladimir Putin's victory seems assured.
In his first social media post since his disappearance, Navalny said the 20-day journey to his new place of detention had been "quite tiring".
"But I'm in a good frame of mind, like Santa Claus," he added, referring to his "beard" that grew during the long journey as well as his new winter clothes adapted to the polar temperatures.
"Anyway, don't worry about me. I am good. I'm relieved to have finally arrived," said the opposition leader, who was able to see his lawyer on Monday, according to his aides.
A charismatic anti-corruption activist and Vladimir Putin's number one enemy, Alexei Navalny, 47, is serving a 19-year prison sentence for "extremism". He was arrested in January 2021 after returning from Russia from convalescing in Germany for a poisoning he blames on the Kremlin.
He disappeared in early December from the penal colony in the Vladimir region, 250 kilometres east of Moscow, where he had been held until then, which meant that he would likely be transferred to another facility.
In Russia, such journeys often take weeks by train and in several stages, with relatives of detainees remaining without news during this period.
"Polar Wolf"
According to the "extremism" verdict against Navalny, the opponent must serve his sentence in a "special regime" colony, the category of facilities with the harshest conditions and usually reserved for lifetime sentence and the most dangerous prisoners.
The colony where Navalny is currently detained, nicknamed "Polar Wolf", is a legacy of the Soviet Gulag. The inmates work there, among other things, tanning and sewing reindeer skins, which are used by the local indigenous people.
He said he arrived at his new place of detention on Saturday evening, after a discreet journey with "such a strange itinerary" that he did not expect to be found by his relatives until mid-January.
"That's why I was surprised when the cell door opened yesterday and I was told, 'A lawyer is here for you,'" he said, expressing gratitude for the "support" expressed.
One of his close aides, Ivan Zhdanov, accused the Russian authorities of trying to "isolate" him in the run-up to the presidential election.
According to him, Alexei Navalny is being held in "one of the northernmost and most remote settlements" in Russia, where conditions are "difficult".
In the West, his disappearance had caused concern, not quite appeased by his reappearance in a very remote region.
The United States said on Monday it was "deeply concerned" about the "conditions of detention" of Alexei Navalny, demanding his release.
Navalny's movement has been methodically eradicated by the government in recent years, pushing his collaborators and allies into exile or prison.
In early December, Russian authorities filed a new case for "vandalism" against the anti-corruption activist, which could add three years to his sentence.
Vladimir Putin is aiming for another six-year term in the Kremlin in the March presidential election, a term that would take him until 2030, the year he turns 78.
* * *
Getting clear on the skeleton functions in Synfig:
One gets an independent skeleton by creating a new layer from the properties panel
before creating it.
To link the skeleton to the object, chosse the object holding down control and linking
with the skeleton element on a right click 'Link to bone' command.
It is ironical: my father used to joke to me to 'put on my
Pennman' s' when heading on particularly cold days. Pennman's is
a Canadian brand of clothing, known in the early 20th century for
its longjohns.
Well today, the first Christmas Eve with no snow in memory, I am about
to go out in a brand new pair of Pennman's jeggings, size four which I
picked up at Walmart's the other day. A bit loose, but after I wash them I
know they will fit great. Hoorah for Pennman's!!
I also watched a movie on the internet, last night, a Star Trek Movie from 2013
with a whole new set of actors playing Kirk, Spock, Scotty...It was great,
but clearly cinematic where the original was a black and white television event.
I think it might have been made with a wink to us original fans of the product.
At one point, Spock asks for advice to the elder Spock - played by Leonard
Nimoy - with no backstory covering the rest of the modernized characters. Who
cares, this was a ripper. the link below:
https://youtu.be/Wzs6f5G7I-o?si=qW5LZij3zSkU2LJh
Will be going back to Synfig later today. I know I can do this!!
I just knew I would be having trouble with this, and I did. I'm on
Sybfig Lesson 7, Bones where I am trying to rig a character together
from it's parts. spent a long time trying to create a child bone to a skeleton one.
The interface has changed in the latest version, and I just discovered
the new tool. It is in the tool box, and meant to add a skeleton and child bones
easypeasy.
Worked through a new Aspen tutorial illustrating collision detection. We now have
both the dog sprite and the food sprites defined in OOP ie with classes and '.self' reference.
This game consists of the pooch scoring the food bowls. The scoring has yet to be
worked through...
import pygame
import random
# Pygame Setup Stuff
pygame.init()
WINDOW_WIDTH = 800
WINDOW_HEIGHT = 500
screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT))
pygame.display.set_caption('Codemy.com - Aspen Classes')
clock = pygame.time.Clock()
running = True
dt = 0
player_pos = pygame.Vector2(screen.get_width() / 2, screen.get_height() / 2)
# Define an Aspen Class
class Aspen(pygame.sprite.Sprite):
def __init__(self, x, y, food_group):
super().__init__()
# Define our image
self.image = pygame.image.load("images/aspen2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = 5
# Add food group to aspen class
self.food_group = food_group
def update(self):
self.move()
self.check_collisions()
def move(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
self.rect.x -= self.velocity
if keys[pygame.K_RIGHT]:
self.rect.x += self.velocity
if keys[pygame.K_UP]:
self.rect.y -= self.velocity
if keys[pygame.K_DOWN]:
self.rect.y += self.velocity
def check_collisions(self):
if pygame.sprite.spritecollide(self, self.food_group, True):
print(len(self.food_group))
# Define an Food Class
class Food(pygame.sprite.Sprite):
def __init__(self, x, y):
super().__init__()
# Define our image
self.image = pygame.image.load("images/food2.png")
# Get Rect
self.rect = self.image.get_rect()
# Position the image
self.rect.topleft = (x, y)
# Move the image
self.velocity = random.randint(1, 2)
def update(self):
self.rect.y += self.velocity
# Create an food group
food_group = pygame.sprite.Group()
# Create 5 aspens
for i in range(8):
food = Food(i * 100, 10)
food_group.add(food)
# Create aspen group
aspen_group = pygame.sprite.Group()
# Create and position aspen
aspen = Aspen(200, 400, food_group)
# Add aspen to the group
aspen_group.add(aspen)
while running:
# poll for events
# pygame.QUIT event means that the user clicked the X to close the window
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# Pick the screen color
screen.fill("silver")
# Blit (copy) screen object at a given coordinates
# screen.blit(aspen, aspen_rect)
# Draw and Move Food and Aspen sprite
food_group.update()
food_group.draw(screen)
aspen_group.update()
aspen_group.draw(screen)
# flip the display to output our work to the screen
pygame.display.flip()
# Set the clock stuff / delta time in seconds since the last frame
# used for framerate independent physics
dt = clock.tick(60) / 1000
pygame.quit()
First day of winter, but things feel odd. It is cold but there is no snow,
and we are headed for a green Christmas in the Montreal region. Still,
good to turn the corner on long nights.
Asked Bing Create for an image from Finland. Yo, wintertime...
Synfig lesson 6, the talking boy, is done. The synchro is pretty bad. I need
to work on this!!
Dreaming Big, this morning. I will soon be able to animate...
I've become fascinated by an aspect of the Synfig interface which the course
seems to enjoy. It is a keyboard overlay, a set-up often used by gamers to show
what they are doing while streaming their gameplay. This one doesn't show the whole
keyboard at once, but only Mouse, Ctrl, Alt and the key. Enter also appears on
the right now and then. Nice.
I've been looking high and low but cannot seem to find the program. The course
was originally recorded on a Russian keyboard.
Character 1 is now assembled, and wired. The assembly involves a group of all
parts that are scaled as a group. The wiring uses the control function to assign
a pivot to each moving part, and groups the body parts as a sub-group that can
move as one...(Yes, I had to go through it more than once :-])
Lesson 3 of Synfig tutorials contains really invaluable information about
the settings needed to render one's work.
1- To create a standard .avi, one needs to specify where the rendered animation will go
but also the rendering codec, here ffmpeg, under Target.
in another video:
Worked through the Codemy tuto for this week. Learning how
to generate multiple Sprites. These use the draw(0 function to go
to the screen.
import random
import pygame
class Sprite(pygame.sprite.Sprite):
def __init__(self, x, y, width, height, color):
super().__init__()
self.x = x
self.y = y
self.width = width
self.height = height
self.color = color
self.rect = pygame.Rect(x, y, width, height)
def update(self):
pass
sprite_group = pygame.sprite.Group()
used_positions = set()
for i in range(5):
while True:
x = random.randrange(0, 800, 30)
y = random.randrange(0, 600, 30)
if (x, y) not in used_positions:
used_positions.add((x, y))
break
sprite = Sprite(x, y, 30, 30, (255, 0, 0))
sprite_group.add(sprite)
# Example usage
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
sprite_group.update()
sprite_group.draw(window)
pygame.display.flip()
It's actually very clever. A set can never have any repeats!!
* * *
Not sure about this approach...
I'm happy; I've found a series of fourteen tutorials on Synfig (translated from the Russian,
no less) that are a great help. From the first, which introduces the interface, I've cleared up
some things for myself.
The big find, 'feathering'. Could never understand what this was about... It is the capacity
to more or less blur the edges of objects. Synfig is not meant for frame by frame drawing
like traditional animation, but relies on machine function. That is why, at first anyway, it seems
impossibly fastiduous. I'm starting to get it...
My circles have 5pt, 10 and 15 feathering settings: