Skip to content

Commit

Permalink
poems
Browse files Browse the repository at this point in the history
  • Loading branch information
eguneys committed Jan 4, 2024
1 parent 40701d1 commit db371d4
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 1 deletion.
58 changes: 58 additions & 0 deletions content/poems/en.poem
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Shimzy stars, let be yours,
But don’t fall in love little one,
Let it crack the fires beneath you.
You might as well catch one.

stars, will live onto it,
it is the future as you predicted,
unlike you’ve ever seen before,
surprised?, well well well on you.

shinzy little star came to me,
and said, yes you are it.
really not really but yes and yes,
earth fall upon graveyards of the future.

Simple but craving inward,
Fast yet inching its way outward.
Witzy, watzy, shill friend,
This isn’t your usual bedtime blend.

since the world started spinning,
spin spin all around
overclocked users complain
give us my witz and history back.

Genes in the bottle,
Looking inside the glass.
How are you qualified?
“I don’t know, factory girl,” alas.

Simpler times, have been passing,
Let’s keep it really simple, and dollars.
That’s my 2 cents to thisness.

“Cripple your way up,
It’s not coming fast. But too slow,
you might as well stop.
Just kidding, take your time.”

“Same guidance, from both approaches.
One is kind, one is light.
Light is starry and shiny.
Kind is bloated and furry.”

“Let’s come to simpler terms.
You take me, I take you.
But beware of your words.
This is not the old Sparta.”

“However you like it.
Come and go as you please.
Just one thing to mention in between.
Words are referencing your dogs.”

“Symbolism is effective.
Interaction into the wild oaks.
They tell me your stories.
Inside the joke teller’s guide to the galaxy.”
36 changes: 36 additions & 0 deletions src/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import Trans, { languages } from './trans'
import { limit_settings, cards_settings, SolitaireStore, GeneralStore } from './store'
import { SolitaireResultsStore } from './store'
import { GameResults, OverallResults } from './statistics'
import { Poems } from './poems'


type RectData = {
Expand Down Expand Up @@ -89,6 +90,16 @@ class ArrowUpFire extends Play {
}

export class Background extends Play {

poem_text!: TransText


change_poem() {
this._will_change_poem = true
}

_will_change_poem: boolean = false

_init() {

this.make(RectView, Vec2.make(0, 0), {
Expand All @@ -99,10 +110,35 @@ export class Background extends Play {



let poem = Poems.one()

this.poem_text = this.make(TransText, Vec2.make(1920 / 2, 1080), {
no_trans: true,
width: 1000,
height: 700,
key: poem,
center: true,
color: Color.hex(0xb4beb4)
})



}

life: number = 0

_update() {

this.life += Time.delta
this.poem_text.position.y = 900 + Math.cos(this.life * 0.2) * 400

if (this._will_change_poem) {
if (this.poem_text.position.y > 1100) {
this._will_change_poem = false
this.poem_text.text = Poems.one()
}
}

if (Time.on_interval(ticks.seconds * 3)) {
for (let i = 0; i < Math.random() * 5; i++) {
let x = 400 + Math.random() * 1000
Expand Down
25 changes: 25 additions & 0 deletions src/poems.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import en from '../content/poems/en.poem?raw'
import { arr_random } from './util'

class Poems {
static load = () => {


let verses = en.split('\r\n\r\n')

return new Poems(verses)

}


constructor(readonly verses: string[]) {}


one() {
return arr_random(this.verses, Math.random)
}
}

let poems = Poems.load()

export { poems as Poems }
4 changes: 3 additions & 1 deletion src/solitaire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { card_sort_key, Settings } from 'lsolitaire'
import { Nine } from './nine'
import { SolitaireResultsStore } from './store'
import { SolitaireGameResult } from './statistics'
import { Poems } from './poems'

let rnd_screen_poss = [...Array(50).keys()].map(() => v_random().mul(v_screen.scale(0.8)))

Expand Down Expand Up @@ -655,7 +656,7 @@ export class SolitairePlay extends Play {

let sidebar: SideBar

this.make(Background, Vec2.zero, undefined)
let background = this.make(Background, Vec2.zero, undefined)

this.over_confetties.push(
this.make(GameOverConfetti, Vec2.make(0, 0), {})
Expand Down Expand Up @@ -692,6 +693,7 @@ export class SolitairePlay extends Play {
game_over_dialog = undefined
}
Sound.play('new_game')
background.change_poem()
}

const on_game_over = (_: Settings, score: number) => {
Expand Down

0 comments on commit db371d4

Please sign in to comment.