Concentricious, an original game made in about three hours. You control a circle, circling a number of circles (or rings), trying to "dunk" squares into the centre.
The circle travels around the rings. You switch rings with the LMB (outwards) and RMB (inwards). Run into squares to knock them closer to the centre, gaining points as you do. Extra points for getting them in. Squares exist for a limited amount of time, losing it fastest on the outside rings.
Your circle and the squares travel in opposite directions. The direction alternates between each ring. You travel fastest on the inside ring. You have a certain amount of life. It is constantly decreasing, but gaining points increases it. When it's gone, game over.
Code (a bit mess, but hey):
set display mode 1280, 800, 32, 1
sync on
sync rate 60
global Angle as float = 0
global X as float = 0
global Y as float = 0
global Dist as float = 300.0
global DistDest as integer = 300
global DistLevel as integer = 3
global DistLevelDest as integer = 3
global bJump as boolean = 0 //0-no jump, 1-switch, 2-jump
global JumpVel as float = 0
global StageLevels = 4
global StageScoreOld = 0
global StageScore = 0
global StageLife = 1000
type tObstacle
X as float
Y as float
Dist as float
DistDest as integer
DistLevelStart as integer
DistLevel as integer
DistLevelDest as integer
Angle as float
bJump as integer
JumpVel as float
Obstacle as integer //0-basic obstacle, 1-follower, 2-item
Exist as boolean
CollidePlayer as boolean
Life as integer
endtype
dim Obstacle(-1) as tObstacle
global ObstacleDelay as float = 150.0
global ObstacleDelayMax as integer = 100
global ObstacleTotal as integer = 0
global ObstacleTotalMax as integer = 100
global MX as integer = 0
global MY as integer = 0
global MC as integer = 0
global MCOld as integer = 0
do
// Input.
MX = mousex()
MY = mousey()
MCOld = MC
MC = mouseclick()
if (MC = 1 or MC = 2) = 0 then MC = 0
// Control player.
if bJump <> 1 then Angle = wrapvalue(Angle + ((-1.2 + ((DistLevel mod 2) * 2.4)) * (1 + ((StageLevels - DistLevel) / 2))))
X = 640 + (cos(Angle) * Dist)
Y = 400 + (sin(Angle) * Dist)
if bJump = 0
`if sqrt(((X - MX) * (X - MX)) + ((Y - MY) * (Y - MY))) =< 40
if MCOld = 0
if MC = 1 and DistLevel < StageLevels
bJump = 1
JumpVel = 11
inc DistDest, 85
inc DistLevelDest
endif
if MC = 2 and DistLevel > 1
bJump = 1
JumpVel = 0
dec DistDest, 85
dec DistLevelDest
endif
endif
`endif
else
inc Dist, JumpVel
dec JumpVel, 0.8
if Dist =< DistDest and JumpVel =< 0
Dist = DistDest
DistLevel = DistLevelDest
bJump = 0
endif
endif
// Control Obstacles.
dec ObstacleDelay, 1
if array count(Obstacle(0)) <> -1
for n = 0 to array count(Obstacle(0))
if Obstacle(n).Exist = 1
Obstacle(n).X = 640 + (cos(Obstacle(n).Angle) * Obstacle(n).Dist)
Obstacle(n).Y = 400 + (sin(Obstacle(n).Angle) * Obstacle(n).Dist)
if Obstacle(n).bJump = 0
Obstacle(n).Angle = wrapvalue(Obstacle(n).Angle - ((-1 + ((Obstacle(n).DistLevel mod 2) * 2)) * (1 + ((StageLevels - Obstacle(n).DistLevel) / 2))))
if Obstacle(n).CollidePlayer = 1
Obstacle(n).CollidePlayer = 0
Obstacle(n).bJump = 1
Obstacle(n).JumpVel = 0
dec Obstacle(n).DistDest, 85
dec Obstacle(n).DistLevelDest
inc StageScore, 10 * (1 + Obstacle(n).DistLevelStart - Obstacle(n).DistLevel)
endif
else
inc Obstacle(n).Dist, Obstacle(n).JumpVel
dec Obstacle(n).JumpVel, 0.25
if Obstacle(n).Dist =< Obstacle(n).DistDest and Obstacle(n).JumpVel =< 0
Obstacle(n).Dist = Obstacle(n).DistDest
Obstacle(n).DistLevel = Obstacle(n).DistLevelDest
Obstacle(n).bJump = 0
if Obstacle(n).DistLevel = 0
inc StageScore, Obstacle(n).DistLevelStart * 10
inc StageLife, Obstacle(n).DistLevelStart * 50
Obstacle(n).Exist = 0
dec ObstacleTotal
endif
endif
endif
dec Obstacle(n).Life, Obstacle(n).DistLevel
if Obstacle(n).Life =< 0
Obstacle(n).Exist = 0
dec ObstacleTotal
endif
endif
next n
endif
// Create New Obstacles.
if ObstacleDelay < 0
ObstacleDelay = ObstacleDelayMax
if ObstacleTotal < ObstacleTotalMax
// Find free Obstacle.
I = array count(Obstacle(0)) + 1
if array count(Obstacle(0)) = -1
I = 0
else
for n = 0 to array count(Obstacle(0))
if Obstacle(n).Exist = 0 then I = n : exit
next n
endif
if I > array count(Obstacle(0)) then array insert at bottom Obstacle(0)
// Define Obstacle.
temp = 1 + rnd(StageLevels - 1)
Obstacle(I).X = 0
Obstacle(I).Y = 0
Obstacle(I).Dist = 662
Obstacle(I).DistDest = 110 + ((temp - 1) * 85)
Obstacle(I).DistLevelStart = temp
Obstacle(I).DistLevel = temp
Obstacle(I).DistLevelDest = temp
Obstacle(I).Angle = rnd(360)
Obstacle(I).bJump = 1
Obstacle(I).JumpVel = 0
Obstacle(I).Obstacle = 0
Obstacle(I).Exist = 1
Obstacle(I).CollidePlayer = 0
Obstacle(I).Life = 2000
inc ObstacleTotal
endif
endif
// Control Score/Life.
StageScoreOld = StageScore
inc StageLife, StageScore - StageScoreOld - 1
lock pixels
// Background circles.
`ink rgb(96, 96, 96), 0
for n = 1 to StageLevels
ink rgb((n mod 2) * 223, (1 - (n mod 2)) * 192, 0), 0
circle 640, 400, 90 + ((n - 1) * 85)
next n
// Obstacles.
if array count(Obstacle(0)) <> -1
for n = 0 to array count(Obstacle(0))
if Obstacle(n).Exist = 1
ink rgb(127.0 + ((Obstacle(n).Life / 2000.0) * 128.0), 0, 0), 0
Draw_ObstacleBox(n)
endif
next n
endif
// Player circle.
ink rgb(255, 255, 255), 0
circle X, Y, 40
// Life.
if StageLife > 200 then temp$ = "LIFE" else temp$ = "HURRY!"
center text 640, 385, temp$
center text 640, 400, str$(StageLife)
// Score.
center text 640, 495 + ((StageLevels - 1) * 85), "SCORE"
center text 640, 510 + ((StageLevels - 1) * 85), str$(StageScore)
// Title/Credits.
text 0, 0, "Concentricious Demo"
text 1280 - text width("Tom Knowles"), 0, "Tom Knowles"
// Debug.
`print DistLevel
`print DistLevelDest
`print StageScore
unlock pixels
// Game Over?
if StageLife <= 0
exit prompt "You got " + str$(StageScore) + " points!", "ACK! Game Over."
end
endif
sync
cls 0
loop
function Draw_ObstacleBox(n)
// Declare locals.
local X1 as integer = 0
local Y1 as integer = 0
local X2 as integer = 0
local Y2 as integer = 0
local X3 as integer = 0
local Y3 as integer = 0
local X4 as integer = 0
local Y4 as integer = 0
local fAngle as integer = 0
local fSize as float = 28.284271247461900976033774484194
// Setup variables.
X1 = Obstacle(n).X + (cos(Obstacle(n).Angle + 225) * fSize)
Y1 = Obstacle(n).Y + (sin(Obstacle(n).Angle + 225) * fSize)
X2 = Obstacle(n).X + (cos(Obstacle(n).Angle + 315) * fSize)
Y2 = Obstacle(n).Y + (sin(Obstacle(n).Angle + 315) * fSize)
X3 = Obstacle(n).X + (cos(Obstacle(n).Angle + 135) * fSize)
Y3 = Obstacle(n).Y + (sin(Obstacle(n).Angle + 135) * fSize)
X4 = Obstacle(n).X + (cos(Obstacle(n).Angle + 45) * fSize)
Y4 = Obstacle(n).Y + (sin(Obstacle(n).Angle + 45) * fSize)
line X1, Y1, X2, Y2 // top-left to top-right
line X1, Y1, X3, Y3 // top-left to bottom-left
line X3, Y3, X4, Y4 // bottom-left to bottom-right
line X2, Y2, X4, Y4 // top-right to bottom-right
//work out collision with player
if Obstacle(n).DistLevel = Obstacle(n).DistLevelDest
if CX_2D_CircleLine(X, Y, 40, X1, Y1, X2, Y2)
Obstacle(n).CollidePlayer = 1
else
if CX_2D_CircleLine(X, Y, 40, X1, Y1, X3, Y3)
Obstacle(n).CollidePlayer = 1
else
if CX_2D_CircleLine(X, Y, 40, X3, Y3, X4, Y4)
Obstacle(n).CollidePlayer = 1
else
if CX_2D_CircleLine(X, Y, 40, X2, Y2, X4, Y4)
Obstacle(n).CollidePlayer = 1
else
Obstacle(n).CollidePlayer = 0
endif
endif
endif
endif
endif
endfunction
`==============================================
`Returns 1 if the circle(c) intersects line(ln)
`0 if not
`==============================================
function CX_2D_CircleLine(CX as float, CY as float, CR as float, LX1, LY1, LX2, LY2)
d# = CX_2D_DistancePointLine#(CX, CY, LX1, LY1, LX2, LY2)
if d# <= CR then exitfunction 1
endfunction 0
`==============================================
`Returns the distance between point(P) and
`the line segment(LN). If the point is beyond
`the line's endpoints, then the distance returned
`is that of the point from the nearest endpoint.
`In other words, this does not test an infinte line
`==============================================
function CX_2D_DistancePointLine#(PX, PY, LX1, LY1, LX2, LY2)
n# = (PX-lX1)*(LX2-LX1) + (PY-LY1)*(LY2-LY1)
x# = LX2 - LX1
y# = LY2 - LY1
d# = x#*x# + y#*y#
u# = n# / d#
dist# = 0.0
if u# >= 0 AND u# <= 1
IX = LX1 + u#*(LX2-LX1)
IY = LY1 + u#*(LY2-LY1)
dist# = CX_2D_lineLength#(PX, PY, IX, IY)
else
if u# < 0 then dist# = CX_2D_lineLength#(PX, PY, LX1, LY1)
if u# > 1 then dist# = CX_2D_lineLength#(PX, PY, LX2, LY2)
endif
endfunction dist#
`==============================================
`Returns the distance between two 2D points
`==============================================
function CX_2D_LineLength#(AX, AY, BX, BY)
x# = BX - AX
y# = BY - AY
d# = sqrt(x#*x# + y#*y#)
endfunction d#
Includes some very helpful (slightly modified) functions by Phaelax. Plays in 1280x800. Had a quick try myself, got 2580pts. Edit: tried again, stopped at 20000. Favour the outer rings. Screen:
@IanM: Sorry, forgot. Thanks for adding it.
Space Game - DarkEye - Concentricious - Puyo
Oh 200 character limit you card