My work for toay: adapting a 2d array shuffle algorithm from
java to lua...
So far:
* * *
The [3][2] spot now shows 13:
* * *
My work for toay: adapting a 2d array shuffle algorithm from
java to lua...
So far:
* * *
The [3][2] spot now shows 13:
* * *
Now have the image appearing as tiles: one of each and no
doubles. Just need to integrate a shuffle!
* * *
It's a start! Not a real pro shuffle, but my homie concoction gives
something to play with:
Been thinking it would be a waste to let that playable grid on match5
not be recycled into something more general Like making a puzzle with
a difficult image...
Now having the image appear. The actual grid is still in match3 mode🤨
Been trying to use the knife code: a daunting experience.
It works as an extension to lus, but the particuliarities of
love2d make things difficult:
* * *
On top of things, this morning. Am now running The timer in the load
function (where things are only called once !?). With a little ingenuity - and
more Timers - should be able to get a scene going...
Long a liberal newspaper, they are now registered as a non-profit (2018) but
continue to run on a non-aligned stance. They are totally digital.
As for vaccination, the US has yet to approve the AstraZeneca and have been
forwarding their stash to Canada, which has been a Godsend for our lagging
vaccination effort. Many Thanks.
Been playing with the notion of timers, which become important
in interpolation programs. One can have objects advance at different
rates with love2d as is, but if we become in interested in when they stop,
then one needs fancier code. Enter libraries, such as knife.
The term for game interpolation is tweening. Another term to know is easing,
having objects accelerate on departure and decelerate at arrival. One tweens
to ease...
Tweens1 was done with the love timer; Tweens2 with that from knife and shows
opacity coming in at different rates!
I've got it down to three birds, but still having trouble with the random position
version. Problem is, if love does two random oprations within one second of each
other, it will be using the same random seed, and to birds will be on the same y position.
Been thinking of running a problem with pi in between...😗
Looking at the translate command, used inside of love.draw().
It does just that: move the coordinates, and just once. Below, the
result. Yellow is placed off-screen but translate brings it back...
In contrast, the update function, called every time the screen is redrawn.
Below, green overtakes yellow...
The brick wall, in Tiles1.lua, is not continuous. Been
revisiting the algorithm from Bird that scrolled the background:
The original background image is 1984 x 288. The screnn dimensions
requested are 800 x 600. By the terms of the algorithm, the image will
be drawn progressively from off-screen to the left until the offset reaches
800. This will then start all over. At a speed of 30 pixels per second, this should
take 26.6 seconds...
So, working as an exemplary student, I notice the menu in
the masterfile for Mario. One begins with tiles0, inVisual Studio
code.
I had promised to myself I would rest from these gaming
classes I have been slaving on. Couldn't stay away: started listening
to the Mario lecture, which I am planning to approfondir in every detail,
this time. Japanese video games really changed the whole environment
when they came along in the 1980s.
An interesting aside, Le Monde is curently running a piece on the musical theme
from the Legend of Zelda . It is a recognizable icon, but has run through many
variations as the game has evolved. Legend will be the next lecture!! Below:
The Sun UK - a British tabloid - has rebuked Prime Minister Trudeau
for his claim that Britain might be facing a Third Wave of the pandemic.
Well, Ontario certainly is, clocking in at some 5000 new cases per day.and
a strained hospital system, the majority of these cases being the so-called
British variant. What's different about Britain itself: the vaccination rate.
Over half the British population has received a first dose, and that is making
a difference to the point where pubs have been allowed to re-open.
Canada has been off to the races in buying vaccines, but not in receiving them
or vaccinating people effectively. Here in Quebec, vaccination is on with
no appointment vaccination for those willing to receive the AstraZeneca
vaccine. We have a high overall death rate because so many elderly people
succombed in the first phase, but vaccine roll-out by age group seems to be
working in calming caseloads for now.
Personally, I am lying low although vaccinated with the Pfizer. Just reading
yesterday that it might not be as effective against certain variants, and the makers
predict we will need a third jab and perhaps yearly vaccination thereafter,
I go out for necessary shopping, and am grateful the Shopping Mall is
accessible.
We are a long way from a decent perspertive on what this pandemic has been
all about...
https://coronavirus.data.gov.uk/details/vaccinations
Moving on: I re-instated my score code, with an arrangement
for shiny tiles (in PlayState)
In Board.lua, inserted code - which I lifted outright - for
including the whole row or column. What I couldn't see for
myself was that one can do a 'for... do' loop assigning a series
of y or x values. Now I understand!
* * *
The last part of the assignment struck me as truly Herculean: only allowing
a swap between tiles if it results in a match. Otherwise, reset the board. Just
found the code that does this on a Github. It's actually quite clever: from
Board.lua, have every tile check left, right, top, bottom for a possible match
by actually making the match; then reversing the match and returning true.
If the whole eventually returns false to PlayState, re-set the board.
Now that's programming!