$VERSIONINFO:Comments
=Based
ON 'Rings.' by Gamezaur; Created with QB64.
CONST true
= -1, false
= 0
'Required shared variables for printLarge
initializeCharSetPrintLarge
peg(0).set = emptySet$
'set pegs positions
setPegs
'set combo messages
DIM megaComboMsg$
(1 TO 6) setComboMessages
setRingColors
generateRingImages
generateCrownIcon
generateBG
'flash warning
centerLarge
(_HEIGHT / 2) - fontHeightLarge
(2) / 2, "This game contains bright,", 2centerLarge
(_HEIGHT / 2) + fontHeightLarge
(2) / 2, "rapidly flashing colors.", 2
music = true
sfx = true
loadGame
'load sounds
selectSound
= _SNDOPEN("assets/sounds/select.ogg")
wooshSound
= _SNDOPEN("assets/sounds/woosh.ogg")
woodblock
= _SNDOPEN("assets/sounds/woodblock.wav")
track
(1) = _SNDOPEN("assets/music/track1.ogg")mainTrackVolume = 1
comboSound
(i
) = _SNDOPEN("assets/sounds/" + a$
)
comboSoundFiles:
DATA DO.ogg
,re.ogg
,mi.ogg
,fa.ogg
,sol.ogg
,la.ogg
,si.ogg
,do2.ogg
'if loading sounds took more than 2 seconds, no need to pause
doIntro
'add divs to bg
LINE (3 + peg
(10).x
- (_WIDTH / spacing
/ 2), 3 + peg
(10).y
- (_WIDTH / spacing
/ 2))-(3 + peg
(12).x
+ (_WIDTH / spacing
/ 2), 3 + peg
(12).y
+ (_WIDTH / spacing
/ 2)), _RGB32(255, 15), BF
LINE (peg
(10).x
- (_WIDTH / spacing
/ 2), peg
(10).y
- (_WIDTH / spacing
/ 2))-(peg
(12).x
+ (_WIDTH / spacing
/ 2), peg
(12).y
+ (_WIDTH / spacing
/ 2)), _RGB32(255, 15), BF
'game
animation(0).duration = .25 'board flash
animation(i).duration = .5 'matches
animation(6).duration = 1 'new set spawn
animation(7).duration = 1 'combo info
multiplier = 1
visibleScore = score
visibleHighScore = highscore
DIM button
(100) AS object
'read mouse data
'read keyboard
mainTrackVolume = mainTrackVolume - .05
'redraw board
'print osd
createMainScreenButtons
IF ABS(keyb
) <> 27 AND pauseGame
= false
AND enterSettings
= false
THEN doButtons
printLarge
0, 45, STR$(visibleScore
), 6
drawPegs
generateNewSets
IF ABS(keyb
) <> 27 AND pauseGame
= false
AND enterSettings
= false
THEN checkButtons
IF currentButton
<> prevbt
THEN prevbt = currentButton
'drag?
'are we beginning to drag a ring or set of rings?
dragging = 0
dragging = i
mouseDown = true
IF enterSettings
= false
AND currentButton
= 1 THEN enterSettings = true
IF pauseGame
= false
AND currentButton
= 2 THEN 'pause pauseGame = true
'place rings
placed = false
'check that the chosen peg can hold the current set of rings
placed = true
placed = false
MID$(peg
(i
).set
, j
* 2 - 1, 2) = MID$(peg
(dragging
).set
, j
* 2 - 1, 2) peg(dragging).set = emptySet$
'prepare backup copies for deletion tagging
del(j) = peg(j)
'check matches
totalMatches = 0
previousScore = score
'look for 3 same-color rings on peg(i) --> ((o))
r
(j
) = CVI(MID$(peg
(i
).set
, j
* 2 - 1, 2)) score = score + 3 * multiplier
animation
(0).start
= TIMER animation
(5).start
= TIMER animation(5).x = peg(i).x
animation(5).y = peg(i).y
animation
(5).r
= _RED32(c
(r
(1))) animation
(8).r
= _RED32(c
(r
(1))) del(i).set = emptySet$
addParticles peg(i).x, peg(i).y, 70, c(r(1))
totalMatches = totalMatches + 1
'look for line matches |, -, /, \
checks = 3
r(1) = 1
r(2) = 4
r(3) = 7
nextPeg(1) = 1
nextPeg(2) = 2
checks = 3
r(1) = 1
r(2) = 2
r(3) = 3
nextPeg(1) = 3
nextPeg(2) = 6
checks = 1
r(1) = 1
nextPeg(1) = 4
nextPeg(2) = 8
checks = 1
r(1) = 3
nextPeg(1) = 2
nextPeg(2) = 4
'look at each ring on the first peg of each row
scored = false
s$
= MID$(peg
(r
(i
)).set
, j
* 2 - 1, 2) found1
= INSTR(peg
(r
(i
) + nextPeg
(1)).set
, s$
) found2
= INSTR(peg
(r
(i
) + nextPeg
(2)).set
, s$
) 'match! clear all rings of the same color in this group of pegs
found1
= INSTR(del
(r
(i
) + nextPeg
(k
)).set
, s$
) MID$(del
(r
(i
) + nextPeg
(k
)).set
, found1
, 2) = MKI$(-1) addParticles del
(r
(i
) + nextPeg
(k
)).x
, del
(r
(i
) + nextPeg
(k
)).y
, 23, c
(CVI(s$
)) score = score + multiplier
found1
= INSTR(del
(r
(i
) + nextPeg
(k
)).set
, s$
) scored = true
totalMatches = totalMatches + 1
animation
(0).start
= TIMER animation
(m
).start
= TIMER animation(m).x = peg(r(i)).x
animation(m).y = peg(r(i)).y
'perform deletion, if any items were marked = MKI$(-1)
peg(j) = del(j)
multiplier = multiplier + 1
IF comboSound
(multiplier
- 1) > 0 THEN
animation
(7).start
= TIMER animation
(8).start
= TIMER animation(8).xa = score - previousScore
animation(8).duration = 5
multiplier = 1
IF score
> highscore
THEN highscore
= score
mouseDown = false
dragging = 0
hoverHighlight
checkAvailableMoves
drawRings
doAnimations
updateScore
updateParticles
'update display
settingsScreen
enterSettings = false
keyb = -27
pauseGame = false
'limit fps
saveGame
endScreen
spacing = 6
j = j + 1
peg(i).set = emptySet$
megaComboMsgs:
DATA Fantastic
,Outstanding
,Amazing
,Awesome
,MEGA
,SUPER
i
= i
+ 1: c
(i
) = _RGB32(0, 78, 249) 'blue i
= i
+ 1: c
(i
) = _RGB32(0, 100, 0) 'green i
= i
+ 1: c
(i
) = _RGB32(222, 61, 44) 'red i
= i
+ 1: c
(i
) = _RGB32(216, 216, 44) 'yellow i
= i
+ 1: c
(i
) = _RGB32(233, 139, 17) 'orange i
= i
+ 1: c
(i
) = _RGB32(222, 105, 161) 'pink i
= i
+ 1: c
(i
) = _RGB32(139, 11, 205) 'purple i
= i
+ 1: c
(i
) = _RGB32(55, 211, 211) 'cyan i
= i
+ 1: c
(i
) = _RGB32(255, 255, 255) 'white i
= i
+ 1: c
(i
) = _RGB32(100, 100, 100) 'dark gray
circleImage
(j
, k
) = _NEWIMAGE(k
* 29, k
* 29, 32)
crownIconData:
DATA 0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0 DATA 0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0 DATA 0,0,0,0,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,0,0,0,0 DATA 0,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,0 DATA 1,2,2,1,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,1,2,2,1 DATA 1,2,2,1,0,0,0,0,0,0,1,2,2,1,0,0,0,0,0,0,1,2,2,1 DATA 0,1,1,2,1,1,0,0,0,1,2,2,2,2,1,0,0,0,1,1,2,1,1,0 DATA 0,0,1,2,2,2,1,1,0,1,2,2,2,2,1,0,1,1,2,2,2,1,0,0 DATA 0,0,1,2,2,2,2,2,1,2,2,2,2,2,2,1,2,2,2,2,2,1,0,0 DATA 0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0 DATA 0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0 DATA 0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0 DATA 0,0,0,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,0,0,0 DATA 0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0
introRings
(i
).xa
= RND * _PI(2) introRings
(i
).xv
= RND * 5 introRings
(i
).r
= RND * 30 + 50
introRings(i).xa = introRings(i).xa + .01
introRings(i).r = introRings(i).r + introRings(i).xv
x
= _WIDTH / 2 + COS(introRings
(i
).xa
) * introRings
(i
).r
y
= _HEIGHT / 2 + SIN(introRings
(i
).xa
) * introRings
(i
).r
thisColor
= CVI(MID$(introRings
(i
).set
, j
* 2 - 1, 2)) _PUTIMAGE (x
- (_WIDTH(circleImage
(thisColor
, j
)) / 2), y
- (_HEIGHT(circleImage
(thisColor
, j
)) / 2)), circleImage
(thisColor
, j
)
updateParticles
centerLarge
(_HEIGHT / 2) - fontHeightLarge
(2) + 3, "Tic Tac Toe", 2 centerLarge
(_HEIGHT / 2) + 3, "Rings", 7 centerLarge
_HEIGHT - fontHeightLarge
(2) + 3, "Fellippe Heitor, 2020", 1
centerLarge
(_HEIGHT / 2) - fontHeightLarge
(2), "Tic Tac Toe", 2 centerLarge
(_HEIGHT / 2), "Rings", 7 centerLarge
_HEIGHT - fontHeightLarge
(2), "Fellippe Heitor, 2020", 1
CircleFill peg
(i
).x
, peg
(i
).y
, 3, _RGB32(255)
'new sets must be generated according to
'current board's available positions
IF peg
(10).set
+ peg
(11).set
+ peg
(12).set
= emptySet$
+ emptySet$
+ emptySet$
THEN level = level + 1
maxColors
= map
(level
, 1, 60, 3, UBOUND(c
)) 'as level goes up, add more colors IF maxColors
< 3 THEN maxColors
= 3
pegsUsed = ""
'reset this peg
peg(i).set = emptySet$
'choose an existing peg randomly
thisPeg = newPeg
'found a peg with an empty slot or more
thisPeg = thisPeg + 1
IF thisPeg
> 9 THEN thisPeg
= 1 'full circle
thisPeg = 0
'store the chosen peg's id
IF thisPeg
> 0 THEN pegsUsed
= pegsUsed
+ MKI$(thisPeg
)
'generate a set, with random colors
LOOP WHILE peg
(i
).set
= emptySet$
'can't be empty MID$(peg
(i
).set
, j
* 2 - 1, 2) = MKI$(-1) animation
(6).start
= TIMER
IF TIMER - animation
(i
).start
<= animation
(i
).duration
THEN animSize
= map
(TIMER - animation
(i
).start
, 0, animation
(i
).duration
, 50, 0) CircleFill j
, animation
(i
).y
, k
, _RGB32(animation
(i
).r
, animation
(i
).g
, animation
(i
).b
, 20) CircleFill animation
(i
).x
, j
, k
, _RGB32(animation
(i
).r
, animation
(i
).g
, animation
(i
).b
, 20) CircleFill j
, j
, k
, _RGB32(animation
(i
).r
, animation
(i
).g
, animation
(i
).b
, 20) CircleFill j
, _HEIGHT - j
, k
, _RGB32(animation
(i
).r
, animation
(i
).g
, animation
(i
).b
, 20) FOR k
= 1 TO animSize
* 2 CircleFill animation
(i
).x
, animation
(i
).y
, k
, _RGB32(animation
(i
).r
, animation
(i
).g
, animation
(i
).b
, 20) CIRCLE (peg
(k
).x
, peg
(k
).y
), animSize
* 1.5, _RGB32(255, animSize
/ 2) CIRCLE (peg
(k
).x
, peg
(k
).y
), animSize
, _RGB32(255, animSize
) k
= INT(map
(animSize
, 50, 40, 1, 4)) printLarge
(l
+ _WIDTH - printWidthLarge
(m$
(1), k
)) / 2, (l
+ _HEIGHT - fontHeightLarge
(k
)) / 2 - fontHeightLarge
(k
), m$
(1), k
printLarge
(l
+ _WIDTH - printWidthLarge
(m$
(2), k
)) / 2, (l
+ _HEIGHT - fontHeightLarge
(k
)) / 2, m$
(2), k
printLarge
(_WIDTH - printWidthLarge
(m$
(1), k
)) / 2, (_HEIGHT - fontHeightLarge
(k
)) / 2 - fontHeightLarge
(k
), m$
(1), k
printLarge
(_WIDTH - printWidthLarge
(m$
(2), k
)) / 2, (_HEIGHT - fontHeightLarge
(k
)) / 2, m$
(2), k
animation
(8).x
= lerp
(animation
(8).x
, printWidthLarge
(STR$(visibleScore
), 6) / 2, .06) animation(8).y = lerp(animation(8).y, 45, .06)
a
= dist
(animation
(8).x
, animation
(8).y
, printWidthLarge
(STR$(visibleScore
), 6) / 2, 45) animation(8).start = 0
a = map(a, 0, animation(8).ya, 0, 1024)
COLOR _RGB32(animation
(8).r
, animation
(8).g
, animation
(8).b
, a
) printLarge
2 + animation
(8).x
, 2 + animation
(8).y
, LTRIM$(STR$(animation
(8).xa
)), 4 printLarge animation
(8).x
, animation
(8).y
, LTRIM$(STR$(animation
(8).xa
)), 4
signature = "tttring"
IF signature
<> "tttring" THEN
gameOver = false
score = 0
level = 0
'user just upgraded from first versions?
'retrieve their highscore and kill old file
gameOver = false
score = 0
level = 0
KILL "tictactoering.score"
addedP = 0: p = 0
p = p + 1
addedP = addedP + 1
particle(p).state = true
particle(p).x = x
particle(p).y = y
particle
(p
).xv
= COS(a
) * (RND * 10) particle
(p
).yv
= SIN(a
) * (RND * 10) particle
(p
).start
= TIMER particle
(p
).duration
= RND
IF visibleScore
< score
AND TIMER - lastScoreUpdate
> .05 AND animation
(8).start
= 0 THEN visibleScore = visibleScore + 1
IF visibleHighScore
< highscore
AND TIMER - lastHighScoreUpdate
> .05 AND animation
(8).start
= 0 THEN visibleHighScore = visibleHighScore + 1
lastHighScoreUpdate
= TIMER
particle(i).xv = particle(i).xv + particle(i).xa
particle(i).x = particle(i).x + particle(i).xv
particle(i).yv = particle(i).yv + particle(i).ya + gravity
particle(i).y = particle(i).y + particle(i).yv
particle(i).state = false
CircleFill particle
(i
).x
, particle
(i
).y
, particle
(i
).size
, _RGB32(particle
(i
).r
, particle
(i
).g
, particle
(i
).b
, map
(TIMER - particle
(i
).start
, 0, particle
(i
).duration
, 255, 0))
k = 0
halo = 40
halo = 25
halo = 12
highLit = i
glow = 10
glowStep = .2
IF glowStep
= 0 THEN glowStep
= .2 glow = glow + glowStep
IF glow
< 8 THEN glow
= 8: glowStep
= glowStep
* -1 IF glow
> 16 THEN glow
= 16: glowStep
= glowStep
* -1
k = k + .8
CircleFill peg
(i
).x
, peg
(i
).y
, halo
+ k
, _RGB32(255, j
) CircleFill peg
(i
).x
, peg
(i
).y
, (halo
/ 2) + k
, _RGB32(0, j
)
IF peg
(10).set
<> emptySet$
OR peg
(11).set
<> emptySet$
OR peg
(12).set
<> emptySet$
THEN gameOver = true 'glass is half empty; consider no more moves
IF peg
(i
).set
<> emptySet$
THEN 'can this set fit the board?
placed = true
placed = false
IF gameOver
= false
THEN EXIT FOR 'no need to test further, there's still hope
'is board full?
'that means we used all sets and no matches were found = game over
board$ = ""
board$ = board$ + peg(i).set
x = peg(i).x
y = peg(i).y
thisColor
= CVI(MID$(peg
(i
).set
, j
* 2 - 1, 2)) _PUTIMAGE (x
- (_WIDTH(circleImage
(thisColor
, j
)) / 2), y
- (_HEIGHT(circleImage
(thisColor
, j
)) / 2)), circleImage
(thisColor
, j
)
x0 = R
y0 = 0
e = -R
y0 = y0 + 1
LINE (x
- x0
, y
+ y0
)-(x
+ x0
, y
+ y0
), C
, BF
LINE (x
- x0
, y
- y0
)-(x
+ x0
, y
- y0
), C
, BF
e = e + 2 * y0
LINE (x
- y0
, y
- x0
)-(x
+ y0
, y
- x0
), C
, BF
LINE (x
- y0
, y
+ x0
)-(x
+ y0
, y
+ x0
), C
, BF
x0 = x0 - 1
e = e - 2 * x0
LINE (x
- R
, y
)-(x
+ R
, y
), C
, BF
FUNCTION map!
(value!
, minRange!
, maxRange!
, newMinRange!
, newMaxRange!
) map! = ((value! - minRange!) / (maxRange! - minRange!)) * (newMaxRange! - newMinRange!) + newMinRange!
lerp! = (mult * amt!) * (stp! - start!) + start!
dist!
= _HYPOT((x2!
- x1!
), (y2!
- y1!
))
IF fontSize
= 0 THEN fontSize
= 1
LINE ((x
- fontSize
) + j
* fontSize
+ ((c
- 1) * (fontSize
* 8)), (y
- fontSize
) + i
* fontSize
)-STEP(fontSize
- 1, fontSize
- 1), _DEFAULTCOLOR, BF
LINE ((x
- fontSize
) + j
* fontSize
+ ((c
- 1) * (fontSize
* 8)), (y
- fontSize
) + i
* fontSize
)-STEP(fontSize
- 1, fontSize
- 1), _BACKGROUNDCOLOR, BF
printLarge
(_WIDTH - printWidthLarge
(text$
, fontSize
)) / 2, y
, text$
, fontSize
fontHeightLarge = fontSize * 16
fontWidthLarge = fontSize * 8
printWidthLarge
= fontWidthLarge
(fontSize
) * LEN(text$
)
SUB initializeCharSetPrintLarge
READ charSet
(char
, row
, column
)
charSet8x16:
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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