Posted: 27th Dec 2021 6:33
Thanks Arch-Ok. I actually made doors move like that about 1990 on a C64 using it's keyboard graphics. Memories...

I first wanted to make a 2D basic tron game but it would have been limited to 2 player unless I could come up with some "good enough" AI.
That was the first game I made with the C64. It was simple but my friends and family played it heaps. Tended to make people yell when they crashed. lol
Posted: 29th Dec 2021 1:53
For anyone interested. I can't enter this last mini challenge coz I'm the judge this time but I can make a little something anyway.

Objective - see how few jumps it takes to jump on the gem. Erm... it's at the top. I got it in 27 jumps so far.
Mouse to look
W A S D to move
Spacebar to jump

Two pieces of code. They are the same except the first is less readable being squeezed just about as compact as I could get it.
35 lines.
+ Code Snippet
SetErrorMode(2):width# = GetMaxDeviceWidth():height# = GetMaxDeviceHeight():SetWindowSize(width#,height#,1):SetVirtualResolution(width#,height#):SetSyncRate(30,0):SetScissor(0,0,0,0):UseNewDefaultFonts(1):Create3DPhysicsWorld():Set3DPhysicsGravity(0,-0.15,0):SetGenerateMipmaps(1):SetSkyboxVisible(1):SetSkyBoxHorizonColor(100,100,255):SetSkyBoxSkyColor(100,100,255):setprintsize(height#/25):light1=1:CreatePointLight(light1,0,1000,0,10000,255,255,255):SetPointLightMode(light1,1):ground=createobjectplane(10000,10000):setobjectcolor(ground,40,100,40,255):rotateobjectlocalX(ground,90):Create3DPhysicsStaticBody(ground):setobjectshapebox(ground):SetObjectCollisionMode(ground,1):previousBoxPos#=CreateVector3(0,0,0):currentPos#=CreateVector3(0,0,0):playerPos#=CreateVector3(0,0,0):gemPos#=CreateVector3(0,0,0):maxBoxes=50
for i=1 to maxBoxes
    boxID=i+1000          //Project: jumpy1 - Created: 21-12-29
    if i=1
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25)):SetObjectRotation(boxID,0,random(0,360),0):SetObjectposition(boxID,random(-500,500),random(10,30),random(100,1000)):setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255):SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12)):Create3DPhysicsStaticBody(boxID)
    endif
    if i>1
        SetVector3(previousBoxPos#,getobjectworldX(boxID-1),getobjectworldY(boxID-1),getobjectworldZ(boxID-1))
    repick:
        boxXpos=random(10,100) + getobjectworldX(boxID-1):boxYpos=random(100,150) + getobjectworldY(boxID-1):boxZpos=random(10,100) + getobjectworldZ(boxID-1):SetVector3(currentPos#,boxXpos,boxYpos,boxZpos):boxDist#=GetVector3Distance(previousBoxPos#,currentPos#)
        if GetrawKeyPressed(27) then end
        if boxDist# < 100 then goto repick
        if boxDist# > 200 then goto repick
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25)):SetObjectRotation(boxID,0,random(0,360),0):SetObjectposition(boxID,boxXpos,boxYpos,boxZpos):setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255):SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12)):Create3DPhysicsStaticBody(boxID)
        if i=maxBoxes
            gem=CreateObjectSphere(5,7,7):SetObjectposition(gem,getobjectworldX(boxID),getobjectworldY(boxID)+GetObjectSizeMaxY(boxID)*2,getobjectworldZ(boxID)):setobjectcoloremissive(gem,155,155,155):SetVector3(gemPos#,getobjectworldX(gem),getobjectworldY(gem),getobjectworldZ(gem))
        endif
    endif
next i
cam1=1:SetCameraRange(cam1, 0.1, 50000 ):SetCameraposition(cam1,0,5,0):SetCameraRotation(cam1,0,0,0):man1=CreateObjectsphere(2,6,12):SetObjectposition(man1,0,5,0):setobjectvisible(man1,0):SetObjectRotation(man1,0,0,0):Create3DPhysicsDynamicBody(man1):SetObject3DPhysicsCanSleep(man1,0):ovec = CreateVector3(0,0,0):rvec = CreateVector3(0,0,0):Create3DPhysicsCharacterController(man1,1,ovec,rvec,0.5):Set3DPhysicsCharacterControllerJumpSpeed(man1,4):Set3DPhysicsCharacterControllerFallSpeed(man1,4):Set3DPhysicsCharacterControllerGravity(man1,1):SetObjectCollisionMode(man1,1):SetObject3DPhysicsMass(man1,2):setrawmousevisible(0):SetRawMousePosition(width#/2,height#/2)
do
    if gameover=0
	    mouseX# = (GetRawMouseX()-width#/2)*0.2:mouseY# = (GetRawMouseY()-height#/2)*0.2:RotateCameraLocalX(cam1,mouseY#):SetCameraRotation(cam1,GetCameraAngleX(cam1),GetObjectAngleY(man1),0)
	    If GetCameraAngleX(cam1)>80 Then SetCameraRotation(cam1,80,GetCameraAngleY(cam1),0)
	    If GetCameraAngleX(cam1)<-80 Then SetCameraRotation(cam1,-80,GetCameraAngleY(cam1),0)
	    strafe# = (GetRawKeyState(68) - GetRawKeyState(65)):move# = (GetRawKeyState(87) - GetRawKeyState(83))
	    Move3DPhysicsCharacterController(man1,strafe#,move#,80):Rotate3DPhysicsCharacterController(man1,GetCameraAngleY(cam1)+mouseX#)
	    if GetRawKeyPressed(32)
	        Jump3DPhysicsCharacterController(man1)
	        jumps=jumps+1
	    endif
	    SetCameraPosition(cam1,GetObjectX(man1),GetObjectY(man1)+1,GetObjectZ(man1)):SetVector3(playerPos#,getobjectworldX(man1),getobjectworldY(man1),getobjectworldZ(man1)):gemDist#=GetVector3Distance(playerPos#,gemPos#):if gemDist#<7 then gameover=1
    endif
    setobjectcolor(gem,random(15,255),random(15,255),random(15,255),255):print(" jumps "+str(jumps)):Step3DPhysicsWorld():SetRawMousePosition(width#/2,height#/2):Sync():if GetrawKeyPressed(27) then end
loop



The second has 97 lines and more readable.
+ Code Snippet
SetErrorMode(2):width# = GetMaxDeviceWidth():height# = GetMaxDeviceHeight():SetWindowSize(width#,height#,1):SetVirtualResolution(width#,height#):SetSyncRate(30,0):SetScissor(0,0,0,0):UseNewDefaultFonts(1):Create3DPhysicsWorld():Set3DPhysicsGravity(0,-0.15,0):SetGenerateMipmaps(1)
SetSkyboxVisible(1)
SetSkyBoxHorizonColor(100,100,255)
SetSkyBoxSkyColor(100,100,255)
setprintsize(height#/25)
light1=1
CreatePointLight(light1,0,1000,0,10000,255,255,255)//   Project: jumpy1 - Created: 21-12-29
SetPointLightMode(light1,1)
ground=createobjectplane(10000,10000)
setobjectcolor(ground,40,100,40,255)
rotateobjectlocalX(ground,90)
Create3DPhysicsStaticBody(ground)
setobjectshapebox(ground)
SetObjectCollisionMode(ground,1)
previousBoxPos#=CreateVector3(0,0,0):currentPos#=CreateVector3(0,0,0)
playerPos#=CreateVector3(0,0,0):gemPos#=CreateVector3(0,0,0)
maxBoxes=50
for i=1 to maxBoxes
    boxID=i+1000
    if i=1
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25))
        SetObjectRotation(boxID,0,random(0,360),0)
        SetObjectposition(boxID,random(-500,500),random(10,30),random(100,1000))
        setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255)
        SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12))
        Create3DPhysicsStaticBody(boxID)
    endif
    if i>1
        SetVector3(previousBoxPos#,getobjectworldX(boxID-1),getobjectworldY(boxID-1),getobjectworldZ(boxID-1))
    repick:
        boxXpos=random(10,100) + getobjectworldX(boxID-1)
        boxYpos=random(100,150) + getobjectworldY(boxID-1)
        boxZpos=random(10,100) + getobjectworldZ(boxID-1)
        SetVector3(currentPos#,boxXpos,boxYpos,boxZpos)
        boxDist#=GetVector3Distance(previousBoxPos#,currentPos#)
        if GetrawKeyPressed(27) then end
        if boxDist# < 100 then goto repick
        if boxDist# > 200 then goto repick
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25))
        SetObjectRotation(boxID,0,random(0,360),0)
        SetObjectposition(boxID,boxXpos,boxYpos,boxZpos)
        setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255)
        SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12))
        Create3DPhysicsStaticBody(boxID)
        if i=maxBoxes
            gem=CreateObjectSphere(5,7,7)
            SetObjectposition(gem,getobjectworldX(boxID),getobjectworldY(boxID)+GetObjectSizeMaxY(boxID)*2,getobjectworldZ(boxID))
            setobjectcoloremissive(gem,155,155,155)
            SetVector3(gemPos#,getobjectworldX(gem),getobjectworldY(gem),getobjectworldZ(gem))
        endif
    endif
next i
cam1=1
SetCameraRange(cam1, 0.1, 50000 )
SetCameraposition(cam1,0,5,0)
SetCameraRotation(cam1,0,0,0)
man1=CreateObjectsphere(2,6,12)
SetObjectposition(man1,0,5,0)
setobjectvisible(man1,0)
SetObjectRotation(man1,0,0,0)
Create3DPhysicsDynamicBody(man1)
SetObject3DPhysicsCanSleep(man1,0)
ovec = CreateVector3(0,0,0):rvec = CreateVector3(0,0,0)
Create3DPhysicsCharacterController(man1,1,ovec,rvec,0.5)
Set3DPhysicsCharacterControllerJumpSpeed(man1,4)
Set3DPhysicsCharacterControllerFallSpeed(man1,4)
Set3DPhysicsCharacterControllerGravity(man1,1)
SetObjectCollisionMode(man1,1)
SetObject3DPhysicsMass(man1,2)
setrawmousevisible(0)
SetRawMousePosition(width#/2,height#/2)
do
    if gameover=0
	    mouseX# = (GetRawMouseX()-width#/2)*0.2:mouseY# = (GetRawMouseY()-height#/2)*0.2 
	    RotateCameraLocalX(cam1,mouseY#)
	    SetCameraRotation(cam1,GetCameraAngleX(cam1),GetObjectAngleY(man1),0)
	    If GetCameraAngleX(cam1)>80 Then SetCameraRotation(cam1,80,GetCameraAngleY(cam1),0)
	    If GetCameraAngleX(cam1)<-80 Then SetCameraRotation(cam1,-80,GetCameraAngleY(cam1),0)
	    strafe# = (GetRawKeyState(68) - GetRawKeyState(65)):move# = (GetRawKeyState(87) - GetRawKeyState(83))
	    Move3DPhysicsCharacterController(man1,strafe#,move#,80)
	    Rotate3DPhysicsCharacterController(man1,GetCameraAngleY(cam1)+mouseX#)
	    if GetRawKeyPressed(32)
	        Jump3DPhysicsCharacterController(man1)
	        jumps=jumps+1
	    endif
	    SetCameraPosition(cam1,GetObjectX(man1),GetObjectY(man1)+1,GetObjectZ(man1))
	    SetVector3(playerPos#,getobjectworldX(man1),getobjectworldY(man1),getobjectworldZ(man1))
	    gemDist#=GetVector3Distance(playerPos#,gemPos#)
	    if gemDist#<7 then gameover=1
    endif
    setobjectcolor(gem,random(15,255),random(15,255),random(15,255),255)
    print(" jumps "+str(jumps))
    Step3DPhysicsWorld()
    SetRawMousePosition(width#/2,height#/2)
    Sync()
    if GetrawKeyPressed(27) then end
loop
Posted: 29th Dec 2021 10:19
@ando Nice one !... I have to try several times until I realize that the best way was jump and look down to land on blocks ....I got it in 31 jumps but in the end when I take the gem the screen freezes . I add a line to force the program to create always the same figure ....just before main bucle "for i=1 to maxBoxes " I added SetRandomSeed(1) .
Posted: 29th Dec 2021 12:18
Thanks chafari, I added your random seed code so a pattern can be repeated.
I took out the freeze and made the jump counter reset to 0 if you fall to the ground.
It is a simple little game but it can be a challenge.
99 lines
+ Code Snippet
SetErrorMode(2):width# = GetMaxDeviceWidth():height# = GetMaxDeviceHeight():SetWindowSize(width#,height#,1):SetVirtualResolution(width#,height#):SetSyncRate(30,0):SetScissor(0,0,0,0):UseNewDefaultFonts(1):Create3DPhysicsWorld():Set3DPhysicsGravity(0,-0.15,0):SetGenerateMipmaps(1)
SetSkyboxVisible(1)
SetSkyBoxHorizonColor(100,100,255)
SetSkyBoxSkyColor(100,100,255)
setprintsize(height#/25)
light1=1
CreatePointLight(light1,0,1000,0,10000,255,255,255)//   Project: jumpy1 - Created: 21-12-29
SetPointLightMode(light1,1)
ground=createobjectplane(10000,10000)
setobjectcolor(ground,40,100,40,255)
rotateobjectlocalX(ground,90)
Create3DPhysicsStaticBody(ground)
setobjectshapebox(ground)
SetObjectCollisionMode(ground,1)
previousBoxPos#=CreateVector3(0,0,0):currentPos#=CreateVector3(0,0,0)
playerPos#=CreateVector3(0,0,0):gemPos#=CreateVector3(0,0,0)
maxBoxes=50
SetRandomSeed(1)
for i=1 to maxBoxes
    boxID=i+1000
    if i=1
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25))
        SetObjectRotation(boxID,0,random(0,360),0)
        SetObjectposition(boxID,random(-500,500),random(10,30),random(100,1000))
        setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255)
        SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12))
        Create3DPhysicsStaticBody(boxID)
    endif
    if i>1
        SetVector3(previousBoxPos#,getobjectworldX(boxID-1),getobjectworldY(boxID-1),getobjectworldZ(boxID-1))
    repick:
        boxXpos=random(10,100) + getobjectworldX(boxID-1)
        boxYpos=random(100,150) + getobjectworldY(boxID-1)
        boxZpos=random(10,100) + getobjectworldZ(boxID-1)
        SetVector3(currentPos#,boxXpos,boxYpos,boxZpos)
        boxDist#=GetVector3Distance(previousBoxPos#,currentPos#)
        if GetrawKeyPressed(27) then end
        if boxDist# < 100 then goto repick
        if boxDist# > 200 then goto repick
        CreateObjectbox(boxID,random(5,25),random(5,25),random(5,25))
        SetObjectRotation(boxID,0,random(0,360),0)
        SetObjectposition(boxID,boxXpos,boxYpos,boxZpos)
        setobjectcolor(boxID,random(150,200),random(100,150),random(20,200),255)
        SetObjectScalePermanent(boxID,random(5,15),random(3,13),random(2,12))
        Create3DPhysicsStaticBody(boxID)
        if i=maxBoxes
            gem=CreateObjectSphere(5,7,7)
            SetObjectposition(gem,getobjectworldX(boxID),getobjectworldY(boxID)+GetObjectSizeMaxY(boxID)*2,getobjectworldZ(boxID))
            setobjectcoloremissive(gem,155,155,155)
            SetVector3(gemPos#,getobjectworldX(gem),getobjectworldY(gem),getobjectworldZ(gem))
        endif
    endif
next i
cam1=1:gameover=0
SetCameraRange(cam1, 0.1, 50000 )
SetCameraposition(cam1,0,5,0)
SetCameraRotation(cam1,0,0,0)
man1=CreateObjectsphere(2,6,12)
SetObjectposition(man1,0,5,0)
setobjectvisible(man1,0)
SetObjectRotation(man1,0,0,0)
Create3DPhysicsDynamicBody(man1)
SetObject3DPhysicsCanSleep(man1,0)
ovec = CreateVector3(0,0,0):rvec = CreateVector3(0,0,0)
Create3DPhysicsCharacterController(man1,1,ovec,rvec,0.5)
Set3DPhysicsCharacterControllerJumpSpeed(man1,4)
Set3DPhysicsCharacterControllerFallSpeed(man1,4)
Set3DPhysicsCharacterControllerGravity(man1,1)
SetObjectCollisionMode(man1,1)
SetObject3DPhysicsMass(man1,2)
setrawmousevisible(0)
SetRawMousePosition(width#/2,height#/2)
do
    mouseX# = (GetRawMouseX()-width#/2)*0.2:mouseY# = (GetRawMouseY()-height#/2)*0.2 
    RotateCameraLocalX(cam1,mouseY#)
    SetCameraRotation(cam1,GetCameraAngleX(cam1),GetObjectAngleY(man1),0)
    If GetCameraAngleX(cam1)>80 Then SetCameraRotation(cam1,80,GetCameraAngleY(cam1),0)
    If GetCameraAngleX(cam1)<-80 Then SetCameraRotation(cam1,-80,GetCameraAngleY(cam1),0)
    strafe# = (GetRawKeyState(68) - GetRawKeyState(65)):move# = (GetRawKeyState(87) - GetRawKeyState(83))
    Move3DPhysicsCharacterController(man1,strafe#,move#,80)
    Rotate3DPhysicsCharacterController(man1,GetCameraAngleY(cam1)+mouseX#)
    if getobjectY(man1)<3
        gameover=0:jumps=0
    endif
    if GetRawKeyPressed(32)
        Jump3DPhysicsCharacterController(man1)
        if gameover=0 then jumps=jumps+1
    endif
    SetCameraPosition(cam1,GetObjectX(man1),GetObjectY(man1)+1,GetObjectZ(man1))
    SetVector3(playerPos#,getobjectworldX(man1),getobjectworldY(man1),getobjectworldZ(man1))
    gemDist#=GetVector3Distance(playerPos#,gemPos#)
    if gemDist#<7 then gameover=1
    setobjectcolor(gem,random(15,255),random(15,255),random(15,255),255)
    print(" jumps "+str(jumps))
    Step3DPhysicsWorld()
    SetRawMousePosition(width#/2,height#/2)
    Sync()
    if GetrawKeyPressed(27) then end
loop
Posted: 29th Dec 2021 21:26
@Arch-Ok that's pretty sweet. It reminds me of a spotlight demo I did in DB but taken to the next level!

Glad to see so many people participating in these.
Posted: 2nd Jan 2022 1:26
Thanks @Phaelax...

Here is my code, which can not be readable even by me now, lol

enjoy;
+ Code Snippet
SetWindowTitle( "Blast Balls" ) :SetWindowSize( 1920, 1080, 0 ) : SetWindowAllowResize( 1 ) :SetVirtualResolution( 1920, 1080 ) :SetOrientationAllowed( 0, 0, 1, 1 ) :SetSyncRate( 30, 0 ) :SetScissor( 0,0,0,0 ) :UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
#Constant _CREATE_COLOR_ ((_C_ > 0) * 0xFF000000) || ((_C_ = 1) * 0x00FF0000) || ((_C_ = 2) * 0x0000FF00) || ((_C_ = 3) * 0x000000FF) || ((_C_ = 4) * 0x00FFFF00) || ((_C_ = 5) * 0x00FF00FF) || ((_C_ = 6) * 0x0000FFFF) || ((_C_ = 7) * 0x00FFFFFF)
Global Map As Integer[32, 32], Lives As Integer, CurrentLives As Integer, ViewLeft As Integer, ViewTop As Integer, ViewRight As Integer, ViewBottom As Integer, BallRadius As Integer, BallSpace As Integer, NextBall As Integer, CurrentBall As Integer, Px As Float, Py As Float, Bx As Float, By As Float, dX As Float, dY As Float, fx As Float, fY As Float, Angle As Float, Bounce As Integer, TotalBlast As Integer, BlastList As Integer[256, 2], Score As Integer, ScoreAdd As Integer, ColorList As Integer, TextMessage As Integer, MessageTime As Integer, MessageVisible As Integer, HiScore As Integer, HiScoreText As Integer, ScoreText As Integer, NewGameText As Integer, QuitText As Integer
BallRadius = 22 :BallSpace = 52 :ViewLeft = 30 :ViewTop = 30 :ViewRight = ViewLeft + 17 * BallSpace + BallSpace/2 :ViewBottom = ViewTop + 15 * BallSpace + BallSpace/2 :Px = ViewLeft + (ViewRight - ViewLeft)/2 :Py = ViewBottom + BallSpace :TextMessage = CreateText("null") :SetTextVisible(TextMessage, 0) :SetTextSize(TextMessage, 100) :SetTextBold(TextMessage, 1) :HiScore = 10000 :HiScoreText = CreateText("Hi - " + Str(HiScore)) :SetTextSize(HiScoreText, 100) :SetTextPosition(HiScoreText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(HiScoreText))/2, 20) :ScoreText = CreateText("Score " + Str(Score)) :SetTextSize(ScoreText, 100) :SetTextPosition(ScoreText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(ScoreText))/2, 320) :NewGameText = CreateText("New Game") :SetTextSize(NewGameText, 100) :SetTextPosition(NewGameText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(NewGameText))/2, 700) :QuitText = CreateText("Quit") :SetTextSize(QuitText, 100) :SetTextPosition(QuitText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(QuitText))/2, 870) :NewGame() :Do :mX = GetPointerX() :mY = GetPointerY()
    If GetPointerState()
		If (mX >= GetTextX(QuitText)) And (mX <= GetTextX(QuitText) + GetTextTotalWidth(QuitText)) And (mY >= GetTextY(QuitText)) And (mY <= GetTextY(QuitText) + GetTextTotalHeight(QuitText)) Then Exit
		If mA And (mX >= GetTextX(NewGameText)) And (mX <= GetTextX(NewGameText) + GetTextTotalWidth(NewGameText)) And (mX >= GetTextY(NewGameText)) And (mY <= GetTextY(NewGameText) + GetTextTotalHeight(NewGameText)) Then NewGame() :mA = 0 :If (Bounce = 0) And (mX >= ViewLeft) And (mX <= ViewRight) And (mY >= ViewTop) And (mY <= ViewRight) Then Bounce = 1
	Else
		mA = 1 :If Bounce = -1 Then Bounce = 0 :If Bounce = 1
			Bounce = 2 :dX = Sin(Angle) * 1000 :dY = Cos(Angle) * 1000
		EndIf :EndIf :If Bounce = 1
		If mY < ViewBottom
			dX = mX - Px :dY = mY - PY :Angle = ATan(dx/dY) :If Angle > 70 Then Angle = 70 :If Angle < -70 Then Angle = -70 :dX = Px - 4 * BallSpace * Sin(Angle) :dY = Py - 4 * BallSpace * Cos(Angle)
		EndIf :DrawLine(Px - BallRadius/2, Py, dX, dY, -1, -1) :DrawLine(Px + BallRadius/2, Py, dX, dY, -1, -1) :EndIf
    If Bounce = 2
		fX = dX/ScreenFPS() :fY = dY/ScreenFPS() :Bx = Bx - fX :By = By - fY
		If (Bx < ViewLeft + BallRadius) Or (Bx > ViewRight - BallRadius)
			Bx = Bx + fX :dX = -dX :fX = - fX :EndIf :Ky = Floor((By - fY - ViewTop)/BallSpace) :Kx = Floor((Bx - fX - ViewLeft)/BallSpace) :Hit = 0
		If (Kx >= 0) And (Kx <= 16) And (Ky >= 0) And (Ky <= 14) 
			If Map[Kx, Ky] Then Hit = 1 :EndIf :If Ky < 0 Then Hit = 1
			If Hit
				Ky = Floor((By - ViewTop)/BallSpace) :Kx = Floor((Bx - ViewLeft)/BallSpace) :Map[Kx, Ky] = CurrentBall :TotalBlast = 0 :_CHECK_BLAST_(Kx, Ky, CurrentBall) :For Y = 0 To 14 :For X = 0 To 16 :Map[X, Y] = Map[X, Y] && 255 :Next :Next :Bx = Px :By = Py :CurrentBall = NextBall :If TotalBlast >= 3
					ScoreAdd = 100 :For Z = 0 To TotalBlast - 1 :DrawScreen() :Sync() :i = Timer() * 1000 :Do :If Abs(i - Timer() * 1000) >= 50 Then Exit :Loop :Map[BlastList[Z, 0], BlastList[Z, 1]] = 0 :Score = Score + ScoreAdd :ScoreAdd = ScoreAdd + 10 :Next :DrawScreen() :Sync() :For X = 0 To 16 :_CHECK_FLOATING_BALLS_(X, 0) :Next :TotalBlast = 0
					For Y = 0 To 14 :For X = 0 To 16
							If Map[X, Y] && 512
								Map[X, Y] = Map[X, Y] && 255 :Continue :EndIf
							If Map[X, Y] && 511
								BlastList[TotalBlast, 0] = X :BlastList[TotalBlast, 1] = Y :TotalBlast = TotalBlast + 1 :Map[X, Y] = Map[X, Y] && 255 :Continue :EndIf :Next :Next :i = Timer() * 1000 :Do :If Abs(i - Timer() * 1000) >= 250 Then Exit :Loop
					For Z = 0 To TotalBlast - 1 :DrawScreen() :Sync() :i = Timer() * 1000 :Do :If Abs(i - Timer() * 1000) >= 50 Then Exit :Loop :Map[BlastList[Z, 0], BlastList[Z, 1]] = 0 :Score = Score + ScoreAdd :ScoreAdd = ScoreAdd + 10 :Next
					SetTextString(ScoreText, "Score " + Str(Score)) :SetTextPosition(ScoreText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(ScoreText))/2, 320)
					If Score > HiScore
						SetTextString(HiScoreText, "Hi - " + Str(Score)) :SetTextPosition(HiScoreText, ViewRight + (1920 - ViewRight - GetTextTotalWidth(HiScoreText))/2, 20) :EndIf :Z = 0 :For Y = 0 To 14 :For X = 0 To 16 :If Map[X, Y] Then Z = 1 :Next :Next :If Z = 0 Then Bounce = 4 :If Score > HiScore Then HiScore = Score
				Else
					CurrentLives = CurrentLives - 1
					If CurrentLives = 0
						Lives = Lives - 1 :If Lives = 0 Then Lives = 7 :CurrentLives = Lives
						For X = 0 To 16
							If Map[X, 14]
								Bounce = 3 :If Score > HiScore Then HiScore = Score :EndIf :Next
						If Bounce <> 3
							For Y = 13 To 0 Step - 1 :For X = 0 To 16 :Map[X, Y + 1] = Map[X, Y] :Next :Next :For X = 0 To 16 :Map[X, 0] = _RANDOM_COLOR_() :Next :EndIf :EndIf :EndIf
				If Bounce = 2
					Bounce = 0 :NextBall = _RANDOM_COLOR_() :EndIf :EndIf :EndIf
    If Bounce = 3
		If Score < HiScore Then SetTextString(TextMessage, "Game Over!") Else SetTextString(TextMessage, "Game Over!" + Chr(13) + Chr(10) + "New High Score!")
		SetTextPosition(TextMessage, ViewLeft + (ViewRight - ViewLeft - GetTextTotalWidth(TextMessage))/2, 220) :SetTextColor(TextMessage, 128, 0, 0, 255) :Bounce = 5 :MessageTime = Timer() * 1000 :MessageVisible = 1 :SetTextVisible(TextMessage, MessageVisible) :EndIf :If Bounce = 4
		If Score < HiScore Then SetTextString(TextMessage, "Conguraltions!") Else SetTextString(TextMessage, "Conguraltions!" + Chr(13) + Chr(10) + "New High Score!")
		SetTextPosition(TextMessage, ViewLeft + (ViewRight - ViewLeft - GetTextTotalWidth(TextMessage))/2, 220) :SetTextColor(TextMessage, 255, 192, 80, 255) :Bounce = 5 :MessageTime = Timer() * 1000 :MessageVisible = 1 :SetTextVisible(TextMessage, MessageVisible) :EndIf
	If Bounce = 5 :If Abs(MessageTime - Timer() * 1000) >= 500
			MessageTime = Timer() * 1000 :MessageVisible = (MessageVisible + 1) && 1 :SetTextVisible(TextMessage, MessageVisible) :EndIf :EndIf :DrawScreen() :Sync()
Loop
Function _RANDOM_COLOR_()
	_GET_COLORS_() :Do :C = 1 + Floor((7 * Random())/65535) :If ColorList && (1 << C) Then Exit :Loop
EndFunction C
Function _GET_COLORS_()
	ColorList = 0 :For Y = 0 To 14 :For X = 0 To 16 :C = Map[X, Y] :If C Then ColorList = ColorList || (1 << C) :If ColorList = 127 Then ExitFunction :Next :Next
EndFunction
Function _CHECK_FLOATING_BALLS_(_X_ As Integer, _Y_ As Integer)
	If _X_ < 0 Then ExitFunction :If _X_ > 16 Then ExitFunction :If _Y_ < 0 Then ExitFunction :If _Y_ > 14 Then ExitFunction :If (Map[_X_, _Y_] && 512) = 512 Then ExitFunction :Map[_X_, _Y_] = Map[_X_, _Y_] || 512 :If (Map[_X_, _Y_] && 511) = 0 Then ExitFunction :For Y = 0 To 2 :For X = 0 To 2 :_CHECK_FLOATING_BALLS_(_X_ - 1 + X, _Y_ - 1 + Y):Next :Next
EndFunction
Function _CHECK_BLAST_(_X_ As Integer, _Y_ As Integer, _C_ As Integer)
	If _X_ < 0 Then ExitFunction :If _X_ > 16 Then ExitFunction :If _Y_ < 0 Then ExitFunction :If _Y_ > 14 Then ExitFunction :If (Map[_X_, _Y_] && 512) = 512 Then ExitFunction :Map[_X_, _Y_] = Map[_X_, _Y_] || 512 :If (Map[_X_, _Y_] && 511) <> _C_ Then ExitFunction :BlastList[TotalBlast, 0] = _X_ :BlastList[TotalBlast, 1] = _Y_ :TotalBlast = TotalBlast + 1 :For Y = 0 To 2 :For X = 0 To 2:_CHECK_BLAST_(_X_ - 1 + X, _Y_ - 1 + Y, _C_) :Next :Next
EndFunction
Function NewGame()
	For Y = 0 To 14 :For X = 0 To 16
			If Y <= 8 Then _C_ = 1 + Floor((7 * Random())/65535) Else _C_ = 0
			Map[X, Y] = _C_
	Next :Next :Lives = 7 :CurrentLives = Lives :CurrentBall = 1 + Floor((7 * Random())/65535) :NextBall = 1 + Floor((7 * Random())/65535) :Score = 0 :Bx = Px :By = Py :Bounce = -1 :MessageVisible = 0 :SetTextVisible(TextMessage, MessageVisible)
EndFunction
Function DrawScreen()
	Drawbox(ViewLeft, ViewTop, ViewRight, ViewBottom, 0x80804000, 0x80804000, 0x80804000, 0x80804000, 1) :Drawbox(ViewRight + 100, ViewTop, 1820, 980, 0x80004080, 0x80004080, 0x80004080, 0x80004080, 1)
	If Bounce <> 5
		For Y = 0 To 14 :For X = 0 To 16 :_C_ = Map[X, Y]
				If _C_ Then DrawEllipse(ViewLeft + X * BallSpace + BallSpace/2, ViewTop + Y * BallSpace + BallSpace/2, BallRadius, BallRadius, _CREATE_COLOR_, 0xFF000000, -1)
		Next :Next :EndIf
	_C_ = NextBall :DrawEllipse(ViewLeft + BallSpace/2, Py, BallRadius, BallRadius, _CREATE_COLOR_, 0xFF000000, 1) :_C_ = CurrentBall :DrawEllipse(Bx, By, BallRadius, BallRadius, _CREATE_COLOR_, 0xFF000000, 1)
	For X = 0 To CurrentLives - 1 :DrawEllipse(ViewLeft + X * BallSpace + BallSpace/2, Py, BallRadius-1, BallRadius-1, 0xFF808080, 0xFF808080, 0) :DrawEllipse(ViewLeft + X * BallSpace + BallSpace/2, Py, BallRadius, BallRadius, 0x80808080, 0x80808080, 0) :Next
EndFunction


Posted: 2nd Jan 2022 1:48
very cool, Arch-Ok.

it's a little different from similar games where alternating rows are staggered and it seemed i could shoot some gaps that i couldn't in others but i was never able to clear the board in those, so... no complaints, here

Posted: 2nd Jan 2022 2:35
Excellent. Only played one game so far, nearly cleared it a couple times then finally got it.

I find these kind of games are good for meditation.
(and new high score, yay)
Posted: 2nd Jan 2022 7:30
Only ten lines. Probably could be optimized for a couple less. Use the arrow keys to shift your dome, and last as long as you can.

+ Code Snippet
type dots:x as float:y as float:endtype:dot as dots[50]:dot[0].x=50:dot[0].y=100:cha=1:secs=timer():SetPrintColor(255,0,0)
do:if cha=1 then dot[0].x = dot[0].x + (GetRawKeyState(37)*-1) + GetRawKeyState(39):DrawEllipse(dot[0].x,dot[0].y,3,3,-1,0,1)
if dot[0].x < 1 OR dot[0].x > 100 then cha = 0
for d = 1 to 50:dot[d].y = dot[d].y - cha
	if dot[d].y < 0:dot[d].x = random2(1,100):dot[d].y = random2(100,250):endif
	if dot[d].y <2:dist = abs((dot[d].x - dot[0].x)):if  dist < 4:cha = 0:dot[0].y=200:endif:endif
	DrawEllipse(dot[d].x,100-dot[d].y,.3,2,-1,-1,1):DrawEllipse(dot[d].x,99-dot[d].y,.6,.6,-1,-1,1)
next d
if cha=1 then gametime$=str(timer()-secs,2) else CreateParticles(1,dot[0].x,99):SetParticlesDirection(1,0,4):SetParticlesTransparency(1,1):AddParticlesColorKeyFrame(1,0,255,255,255,255):AddParticlesColorKeyFrame(1,3,255,0,0,0):SetParticlesSize(1,2):SetParticlesLife(1,4):SetParticlesMax(1,4):
print(gametime$):Sync():loop
Posted: 2nd Jan 2022 8:44
That's very compact and also very hectic, got my blood pumping.
I played a bunch of times and my best score was 44.3 seconds.

Thanks for entering these mini challenges and thanks to everyone that entered, it's been fun.

After this round though, I'm going to have to have a break as I have to work on my Tower Defence project.
I still have a lot of work to do.
Posted: 3rd Jan 2022 0:47
Well I think the deadline has passed.
Only two in it this time.

Rich get points for the least lines of code.
Arch gets lots of points for the fun level in the Blast Balls game.

I have to give the win to Arch. Very well done. I'll keep going back to that game in future.

So now I have to try to get my Tower Defence game done in time. I won't know if I can until the end of the month.

Cheers guys and I'll leave you with the latest version of my Lady Bugs mini game.
I added six levels of difficulty and made it more complete by adding spacebar to restart instead of having to reboot.


+ Code Snippet
// Project: Lady Bugs by ando - may contain a bug
// Created: 21-12-24

SetErrorMode(2)
//SetVSync(1)

Global width# as Float
Global height# as Float

width# = GetMaxDeviceWidth() // I had to use # to stabilise mouselook over different pc's
height# = GetMaxDeviceHeight()
SetWindowSize(width#,height#,1)
SetVirtualResolution(width#,height#) // doesn't have to match the window
SetSyncRate(30,0)
SetScissor(0,0,0,0) // use the maximum available screen space
UseNewDefaultFonts(1)
SetPrintSize(height#/25)
SetSkyboxVisible(1)
SetSkyBoxHorizonColor(0,0,0)

//  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  Screenshot setup

screenGrab = CreateRenderImage(GetMaxDeviceWidth(),GetMaxDeviceHeight(),0,1)
filesavetext=createtext("")
settextvisible(filesavetext,0)

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx map

Global map as integer [19,19]
Global object as integer [19,19]
Global monsterPos as integer [19,19]
Global monster1 as integer
Global player as integer
Global item as integer
Global x,y as integer

restart_here:

AddRow(1 ,"1111111111111111111") // 0 = vacant
AddRow(2 ,"1000000007000000001") // 1 = wall
AddRow(3 ,"1012431011101243101") // 2 = horizontal door left
AddRow(4 ,"1010001000001000101") // 3 = horizontal door right
AddRow(5 ,"1010101124311010101") // 4 = door center
AddRow(6 ,"1050101000001010501") // 5 = virtical door upper
AddRow(7 ,"1040101011101010401") // 6 = virtical door lower
AddRow(8 ,"1060000000000000601") // 7 = player
AddRow(9 ,"1012431010101243101") // 8 = monster
AddRow(10,"1010001010101000101") // 9 = item to collect
AddRow(11,"1010101018101010101")
AddRow(12,"1050101000001010501")
AddRow(13,"1040101010101010401")
AddRow(14,"1060101010101010601")
AddRow(15,"1010101010101010101")
AddRow(16,"1010000010100000101")
AddRow(17,"1011124310124311101")
AddRow(18,"1000000009000000001")
AddRow(19,"1111111111111111111")

Function AddRow(y,data$)
	    for x = 1 to 19
	        tile = VAL(MID(data$,x,1))
	        if tile=0
	            map[x,y]=0
	        endif
	        if tile=1
	            map[x,y]=1
	            object[x,y]=CreateText(chr(127)) //  127  wall
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],50,255,50,150)
	        endif
	        if tile=2
	            map[x,y]=2
	            object[x,y]=CreateText(chr(60)) //   60  door left
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],50,150,255,255)
	            
	            object[x+1,y-1]=CreateText(chr(94)) //   94  door upper invisible
	            SetTextSize(object[x+1,y-1],height#/20)
	            SetTextPosition(object[x+1,y-1],(width#/41)*(x+12)-width#/41+width#*0.0022,(height#/25)*(y+2)-height#/25)
	            SetTextColor(object[x+1,y-1],50,150,255,255)
	            settextvisible(object[x+1,y-1],0)
	            
	            object[x+1,y+1]=CreateText(chr(118)) //   118  door lower invisible
	            SetTextSize(object[x+1,y+1],height#/20)
	            SetTextPosition(object[x+1,y+1],(width#/41)*(x+12)-width#/41+width#*0.0022,(height#/25)*(y+4)-height#/25)
	            SetTextColor(object[x+1,y+1],50,150,255,255)
	            settextvisible(object[x+1,y+1],0)
	        endif
	        if tile=3
	            map[x,y]=3
	            object[x,y]=CreateText(chr(62)) //   62  door right
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],50,150,255,255)
	        endif
	        if tile=4
	            map[x,y]=4
	            object[x,y]=CreateText(chr(847)) //   847  door center
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0085,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],150,200,255,255)
	        endif
	        if tile=5
	            map[x,y]=5
	            object[x,y]=CreateText(chr(94)) //   94  door upper
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],50,150,255,255)
	            
	            object[x-1,y+1]=CreateText(chr(60)) //   60  door left invisible
	            SetTextSize(object[x-1,y+1],height#/20)
	            SetTextPosition(object[x-1,y+1],(width#/41)*(x+10)-width#/41+width#*0.0022,(height#/25)*(y+4)-height#/25)
	            SetTextColor(object[x-1,y+1],50,150,255,255)
	            settextvisible(object[x-1,y+1],0)
	            
	            object[x+1,y+1]=CreateText(chr(62)) //   62  door right invisible
	            SetTextSize(object[x+1,y+1],height#/20)
	            SetTextPosition(object[x+1,y+1],(width#/41)*(x+12)-width#/41+width#*0.0022,(height#/25)*(y+4)-height#/25)
	            SetTextColor(object[x+1,y+1],50,150,255,255)
	            settextvisible(object[x+1,y+1],0)
	        endif
	        if tile=6
	            map[x,y]=6
	            object[x,y]=CreateText(chr(118)) //   118  door lower
	            SetTextSize(object[x,y],height#/20)
	            SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
	            SetTextColor(object[x,y],50,150,255,255)
	        endif
	        if tile=7                         //   PLAYER
                map[x,y]=7
	            object[x,y]=CreateText(chr(79))
                SetTextSize(object[x,y],height#/20)
                SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41,(height#/25)*(y+3)-height#/25)
                player=object[x,y]
	        endif
	        if tile=8                         //   MONSTER
                map[x,y]=0
                monsterPos[x,y]=1
                monster1=CreateText(chr(88))
                SetTextSize(monster1,height#/20)
                SetTextPosition(monster1,(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
                SetTextColor(monster1,255,50,50,255)
	        endif
	        if tile=9                         //   item
                map[x,y]=9
	            object[x,y]=CreateText(chr(164))
                SetTextSize(object[x,y],height#/20)
                SetTextPosition(object[x,y],(width#/41)*(x+11)-width#/41+width#*0.0022,(height#/25)*(y+3)-height#/25)
                SetTextColor(object[x,y],255,255,50,255)
                item=object[x,y]
	        endif
	    next x
EndFunction

score=0
restart=0
level=5
monsterdelay=0

pPosX=10
pPosY=2
placeItem=0

monsterDir$="up"
mPosX=10
mPosY=11


// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  MAIN LOOP

do

//  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  Screenshot Section
	
	if GetRawKeyPressed(80)				// P to screenshot
		SetRenderToImage(screenGrab, -1)
		Print("   LEVEL "+str(6-level))
        Print("   score "+str(score))
		if gettextvisible(filesavetext) then settextvisible(filesavetext,0)
		number = 1
		ClearScreen()
		Render()
checkFiles:
		if GetFileExists("raw:"+GetReadPath()+"screenshots/Screenshot"+str(number)+".png")
			number = number + 1
			goto checkFiles
		endif
		SaveImage(screenGrab, "raw:"+GetReadPath()+"screenshots/Screenshot"+str(number)+".png")
		settextstring(filesavetext,"Image saved as Screenshot"+str(number)+".png in "+ GetReadPath()+"screenshots")
		SetTextSize(filesavetext,GetMaxDeviceHeight()*0.0275)
		textTimer = 1
		SetRenderToScreen()
		if not gettextvisible(filesavetext) then settextvisible(filesavetext,1)
	endif
	
	If textTimer > 0 Then textTimer = textTimer + 1
	If textTimer > 299
		settextvisible(filesavetext,0)
		textTimer = 0
	EndIf

//  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX  end screenshot code

    if gameover=0
        
        if score = 100
            level=4
        elseif score = 200
            level=3
        elseif score = 300
            level=2
        elseif score = 400
            level=1
        elseif score > 495
            level=0
        endif
        
        // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  monster X
        
	    if monsterdelay<level
	        if level<6 then monsterdelay=monsterdelay+1
	    endif
	    
	    if level=monsterdelay
		    if monsterDir$="up"
		        if map[mPosX,mPosY-1]=0 or map[mPosX,mPosY-1]=7 or map[mPosX,mPosY-1]=9
		            monsterPos[mPosX,mPosY]=0
		            monsterPos[mPosX,mPosY-1]=1
		            mPosY=mPosY-1
		            SetTextPosition(monster1,GetTextX(monster1),GetTextY(monster1)-height#/25)
			    else
			        mpick=random(1,3)
			        if mpick=1
			            monsterDir$="down"
			        endif
			        if mpick=2
			            monsterDir$="left"
			        endif
			        if mpick=3
			            monsterDir$="right"
			        endif
		        endif
		        monsterdelay=0
		        if map[mPosX-1,mPosY]=0 or map[mPosX+1,mPosY]=0 or map[mPosX-1,mPosY]=7 or map[mPosX+1,mPosY]=7
		            mpick=random(1,5)
		            if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="left"
			        endif
			        if mpick=3
			            monsterDir$="right"
			        endif
		        endif
		    endif
		    
		    if monsterDir$="down"
		        if map[mPosX,mPosY+1]=0 or map[mPosX,mPosY+1]=7 or map[mPosX,mPosY+1]=9
		            monsterPos[mPosX,mPosY]=0
		            monsterPos[mPosX,mPosY+1]=1
		            mPosY=mPosY+1
		            SetTextPosition(monster1,GetTextX(monster1),GetTextY(monster1)+height#/25)
			    else
			        mpick=random(1,3)
			        if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="left"
			        endif
			        if mpick=3
			            monsterDir$="right"
			        endif
		        endif
		        monsterdelay=0
		        if map[mPosX-1,mPosY]=0 or map[mPosX+1,mPosY]=0 or map[mPosX-1,mPosY]=7 or map[mPosX+1,mPosY]=7
		            mpick=random(1,5)
		            if mpick=1
			            monsterDir$="down"
			        endif
			        if mpick=2
			            monsterDir$="left"
			        endif
			        if mpick=3
			            monsterDir$="right"
			        endif
		        endif
		    endif
		    
		    if monsterDir$="left"
		        if map[mPosX-1,mPosY]=0 or map[mPosX-1,mPosY]=7 or map[mPosX-1,mPosY]=9
		            monsterPos[mPosX,mPosY]=0
		            monsterPos[mPosX-1,mPosY]=1
		            mPosX=mPosX-1
		            SetTextPosition(monster1,GetTextX(monster1)-width#/41,GetTextY(monster1))
			    else
			        mpick=random(1,3)
			        if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="down"
			        endif
			        if mpick=3
			            monsterDir$="right"
			        endif
		        endif
		        monsterdelay=0
		        if map[mPosX,mPosY-1]=0 or map[mPosX,mPosY+1]=0 or map[mPosX,mPosY-1]=7 or map[mPosX,mPosY+1]=7
		            mpick=random(1,5)
		            if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="left"
			        endif
			        if mpick=3
			            monsterDir$="down"
			        endif
		        endif
		    endif
		    
		    if monsterDir$="right"
		        if map[mPosX+1,mPosY]=0 or map[mPosX+1,mPosY]=7 or map[mPosX+1,mPosY]=9
		            monsterPos[mPosX,mPosY]=0
		            monsterPos[mPosX+1,mPosY]=1
		            mPosX=mPosX+1
		            SetTextPosition(monster1,GetTextX(monster1)+width#/41,GetTextY(monster1))
			    else
			        mpick=random(1,3)
			        if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="down"
			        endif
			        if mpick=3
			            monsterDir$="left"
			        endif
		        endif
		        monsterdelay=0
		        if map[mPosX,mPosY-1]=0 or map[mPosX,mPosY+1]=0 or map[mPosX,mPosY-1]=7 or map[mPosX,mPosY+1]=7
		            mpick=random(1,5)
		            if mpick=1
			            monsterDir$="up"
			        endif
			        if mpick=2
			            monsterDir$="right"
			        endif
			        if mpick=3
			            monsterDir$="down"
			        endif
		        endif
		    endif
	    endif
	    
	    // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx item
	    
	    if placeItem=1
	        pickX=random(2,18)
	        pickY=random(2,18)
	        if map[pickX,pickY]=0
	            if map[pickX+1,pickY]<>4 and map[pickX-1,pickY]<>4 and map[pickX,pickY+1]<>4 and map[pickX,pickY-1]<>4
		            map[pickX,pickY]=9
		            SetTextPosition(item,(width#/41)*(pickX+11)-width#/41+width#*0.0022,(height#/25)*(pickY+3)-height#/25)
		            placeItem=0
		            settextvisible(item,1)
	            endif
	        endif
	    endif
	    
	    // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx player
	    
	    if playerdelay < 4
	        playerdelay=playerdelay+1
	    endif
	    
	    if playerdelay=4
		    if GetRawKeyState(38)     //  up
		        if map[pPosX,pPosY-1]=0
		            map[pPosX,pPosY-1]=7
		            map[pPosX,pPosY]=0
		            pPosY=pPosY-1
		            SetTextPosition(player,GetTextX(player),GetTextY(player)-height#/25)
		        elseif map[pPosX,pPosY-1]=2   //  left door
		            settextvisible(object[pPosX,pPosY-1],0)
		            settextvisible(object[pPosX+2,pPosY-1],0)
		            settextvisible(object[pPosX+1,pPosY],1)
		            settextvisible(object[pPosX+1,pPosY-2],1)
		            map[pPosX,pPosY-1]=0
		            map[pPosX+2,pPosY-1]=0
		            map[pPosX+1,pPosY]=6
		            map[pPosX+1,pPosY-2]=5
		        elseif map[pPosX,pPosY-1]=3    // right door
		            settextvisible(object[pPosX,pPosY-1],0)
		            settextvisible(object[pPosX-2,pPosY-1],0)
		            settextvisible(object[pPosX-1,pPosY],1)
		            settextvisible(object[pPosX-1,pPosY-2],1)
		            map[pPosX,pPosY-1]=0
		            map[pPosX-2,pPosY-1]=0
		            map[pPosX-1,pPosY]=6
		            map[pPosX-1,pPosY-2]=5
		        elseif map[pPosX,pPosY-1]=9    // item
		            map[pPosX,pPosY-1]=0
		            settextvisible(item,0)
		            placeItem=1
		            score=score+10
		        endif
		        playerdelay=0
		    elseif GetRawKeyState(40) //  down
		        if map[pPosX,pPosY+1]=0
		            map[pPosX,pPosY+1]=7
		            map[pPosX,pPosY]=0
		            pPosY=pPosY+1
		            SetTextPosition(player,GetTextX(player),GetTextY(player)+height#/25)
	            elseif map[pPosX,pPosY+1]=2   //  left door
		            settextvisible(object[pPosX,pPosY+1],0)
		            settextvisible(object[pPosX+2,pPosY+1],0)
		            settextvisible(object[pPosX+1,pPosY],1)
		            settextvisible(object[pPosX+1,pPosY+2],1)
		            map[pPosX,pPosY+1]=0
		            map[pPosX+2,pPosY+1]=0
		            map[pPosX+1,pPosY]=5
		            map[pPosX+1,pPosY+2]=6
		        elseif map[pPosX,pPosY+1]=3    // right door
		            settextvisible(object[pPosX,pPosY+1],0)
		            settextvisible(object[pPosX-2,pPosY+1],0)
		            settextvisible(object[pPosX-1,pPosY],1)
		            settextvisible(object[pPosX-1,pPosY+2],1)
		            map[pPosX,pPosY+1]=0
		            map[pPosX-2,pPosY+1]=0
		            map[pPosX-1,pPosY]=5
		            map[pPosX-1,pPosY+2]=6
		        elseif map[pPosX,pPosY+1]=9    // item
		            map[pPosX,pPosY+1]=0
		            settextvisible(item,0)
		            placeItem=1
		            score=score+10
		        endif
		        playerdelay=0
		    elseif GetRawKeyState(37)       //  left
		        if map[pPosX-1,pPosY]=0
		            map[pPosX-1,pPosY]=7
		            map[pPosX,pPosY]=0
		            pPosX=pPosX-1
		            SetTextPosition(player,GetTextX(player)-width#/41,GetTextY(player))
		        elseif map[pPosX-1,pPosY]=5         //  upper door
		            settextvisible(object[pPosX-1,pPosY],0)
		            settextvisible(object[pPosX-1,pPosY+2],0)
		            settextvisible(object[pPosX,pPosY+1],1)
		            settextvisible(object[pPosX-2,pPosY+1],1)
		            map[pPosX-1,pPosY]=0
		            map[pPosX-1,pPosY+2]=0
		            map[pPosX-2,pPosY+1]=2
		            map[pPosX,pPosY+1]=3
		        elseif map[pPosX-1,pPosY]=6         // lower door
		            settextvisible(object[pPosX-1,pPosY],0)
		            settextvisible(object[pPosX-1,pPosY-2],0)
		            settextvisible(object[pPosX-2,pPosY-1],1)
		            settextvisible(object[pPosX,pPosY-1],1)
		            map[pPosX-1,pPosY]=0
		            map[pPosX-1,pPosY-2]=0
		            map[pPosX-2,pPosY-1]=2
		            map[pPosX,pPosY-1]=3
		        elseif map[pPosX-1,pPosY]=9    // item
		            map[pPosX-1,pPosY]=0
		            settextvisible(item,0)
		            placeItem=1
		            score=score+10
		        endif
		        playerdelay=0
		    elseif GetRawKeyState(39)  //  right
		        if map[pPosX+1,pPosY]=0
		            map[pPosX+1,pPosY]=7
		            map[pPosX,pPosY]=0
		            pPosX=pPosX+1
		            SetTextPosition(player,GetTextX(player)+width#/41,GetTextY(player))
		        elseif map[pPosX+1,pPosY]=5   //  upper door
		            settextvisible(object[pPosX+1,pPosY],0)
		            settextvisible(object[pPosX+1,pPosY+2],0)
		            settextvisible(object[pPosX,pPosY+1],1)
		            settextvisible(object[pPosX+2,pPosY+1],1)
		            map[pPosX+1,pPosY]=0
		            map[pPosX+1,pPosY+2]=0
		            map[pPosX,pPosY+1]=2
		            map[pPosX+2,pPosY+1]=3
		        elseif map[pPosX+1,pPosY]=6    // lower door
		            settextvisible(object[pPosX+1,pPosY],0)
		            settextvisible(object[pPosX+1,pPosY-2],0)
		            settextvisible(object[pPosX,pPosY-1],1)
		            settextvisible(object[pPosX+2,pPosY-1],1)
		            map[pPosX+1,pPosY]=0
		            map[pPosX+1,pPosY-2]=0
		            map[pPosX,pPosY-1]=2
		            map[pPosX+2,pPosY-1]=3
		        elseif map[pPosX+1,pPosY]=9    // item
		            map[pPosX+1,pPosY]=0
		            settextvisible(item,0)
		            placeItem=1
		            score=score+10
		        endif
		        playerdelay=0
		    endif
	    endif
    endif
    
    if pPosX=mPosX
        if pPosY=mPosY
            gameover=1
        endif
    endif
    
    Print("   LEVEL "+str(6-level))
    Print("   score "+str(score))
    
    if gameover=1
        if restart=0
            if GetRawKeyPressed(32) then restart=1  //  space
            Print(" HIT SPACE TO RESTART ")
        endif
        if restart=1
            gameover=0
            restart=0
            DeleteText(monster1)
            if gettextvisible(filesavetext) then settextvisible(filesavetext,0)
            for x=1 to 19
                for y=1 to 19
                    DeleteText(map[x,y])
                    if not object[x,y]=0 then DeleteText(object[x,y])
                next y
            next x
            goto restart_here
        endif
    endif
    
    Sync()
    if GetrawKeyPressed(27) then end
loop

Posted: 3rd Jan 2022 1:13
congrats, Arch! yours definitely had "the most fun" inside.

i couldn't get in on it this time around but, depending on how soon the next is announced (hint, hint), i hope to submit something for the next challenge.

meanwhile, i plan on adding graphics to Fly Hard and fleshing it out a bit then posting on itch.io someday soon since "1/2 the work" is already done. i hope the rest of you consider doing the same with your creations


add: i know phaelax set the rules according to the old DBPro challenges to include "no external media" but one thing i always wanted to see were challenges set with minimal media provided.

ie, judge provides a set of blocks numbered 0-9 that participants need to use to make a game. or, a simple set of chess pieces with "make something other than chess" out of them. you get the idea. some home-made sound effects, music, whatever could go a long way, as well.

as long as we're all using the same stuff, it's all "fair" in a friendly competition and may open windows to creative winds
Posted: 3rd Jan 2022 10:36
some home-made sound effects, music, whatever could go a long way, as well.

I second that.
I think it would be a lot of fun to see what different ideas people come up with while all using the same media.
Posted: 3rd Jan 2022 21:17
Hey, thank you guys, sorry being late.
This event triggered all of us to create something, that's awesome. I am also developing my ball popping game like those others on the net. If I ever finish it I'll announce it here and release it.



Well, for the next quest, let's create a random 3d city generator with agk with Phaelax's rules, end day willl be sunday, 16th of january. No textures needed, just the geometry will be judged.

Here is my very old city generator;


Edit: Let's longen the end day for a week and set it to 16th January, because everyone is developing their previous entries which is so great.
Posted: 3rd Jan 2022 22:48
reate a random 3d city generator

deal!
Posted: 5th Jan 2022 22:20
@ Virtual Nomad . Nice update to fly hard . Next Friday I am going to have surgery on my arm and I will not be able to participate in this last challenge . in the meantime I've been fiddling with the code and this is my first attempt at random city .

+ Code Snippet
// Project: ramdom City 
// Created: 2022-01-05

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "ramdom City" )
SetWindowSize( 800, 600, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 800, 600 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
setcameraposition(1,-100,200,-200)
SetCameraLookAt(1,0,0,0,0)

`building texture
w=makecolor(100,100,100)
b=makecolor(20,20,20)
drawbox(0,0,100,100,w,w,w,w,1)
drawbox(10,10,30,30,b,b,b,b,1)
drawbox(40,10,60,30,b,b,b,b,1)
drawbox(70,10,90,30,b,b,b,b,1)

`benguismo trick to correct UV scale
SetDefaultWrapU(1)
SetDefaultWrapV(1)
getimage(1,0,0,100,50)

`ramdom city
create()

`main floor
createobjectbox(5000,1200,2,2000)
setobjectposition(5000,500,0,800)
setobjectcolor(5000,100,100,100,255)

`mouse position at start
SetRawMousePosition(-100,768/2)

`sky	
createobjectsphere(5200,5000,10,10)
SetObjectColorEmissive(5200,0,0,50)
SetObjectCullMode(5200,0)
SetCameraRange(1,1,10000)

`-------------------------------------------------------------------------------------------
`shadows setting
shadowMode = 3 // start with cascade shadow mapping which gives the best quality
SetShadowMappingMode( shadowMode )
SetShadowSmoothing( 2) // random sampling
SetShadowMapSize( 2048, 2048 )
SetShadowRange( -1 ) // use the full camera range
SetShadowBias( 0.0012 ) // offset shadows slightly to avoid shadow artifacts
`--------------------------------------------------------------------------------------------
`Sun setting
dx# = 0.3714
dy# = -0.7428
dz# = 0.5571
SetSunDirection( dx#, dy#, dz# )

do
    
if ( GetRawKeyState( 27) ) then  end    
if ( GetRawKeyState( 32) )
  create()
  sleep(200)
endif

	 turn=getpointery()
	 if turn<330 then turn=330
	 if turn>420 then turn=420
	 if turn<331 then SetRawMousePosition( getpointerx(), turn ) 
	 if turn>421 then SetRawMousePosition( getpointerx(), turn ) 
	 if getpointerx()<100 then SetRawMousePosition(460,getpointery()) `si estamos a menos de 100 lo coloca 460    (800-460=340)
	 if getpointerx()>700 then SetRawMousePosition(340,getpointery())  `si estamos a mas de 700 lo coloca en 340  (800-340 =460)
	 movecameralocalz(1,(GetRawKeyState( 38 )*5)-GetRawKeyState( 40 )*5)
	 movecameralocalx(1,(GetRawKeyState( 39 )*5)-GetRawKeyState( 37 )*5)
	 setcamerarotation(1,turn,getpointerx(),0)

    print ("Fly with cursor and mouse")
    Print( "Press Spacebar for new city" )
    
    Sync()
loop

function create()
	kk=0
	for i= 1 to 2000
		if GetObjectExists(i) then deleteobject(i)
	next
	for i= 1 to 1000
		if random(1,30)=1 then t=random(1,200) else t=0     `adding extra big building
		createobjectbox(i,15+random(1,40),10+random(1,80)+t,20+random(1,10))
		setobjectcolor(i,125+random(0,55),125+random(0,55),125+random(0,55),255)
		setobjectimage(i,1,1)
		SetObjectUVScale(i,0,GetObjectSizeMaxx(i)/8,GetObjectSizeMaxY(i)/6)
		SetObjectCastShadow( i, 1 )
	next
	a=GetObjectSizeMaxX(1)

	for i= 2 to 1000
	  setobjectposition(i,getobjectx(i-1)+GetObjectSizeMaxX(i-1)+GetObjectSizeMaxX(i),0,kk)
	  if getobjectx(i)>1000 
		  setobjectposition(i,GetObjectSizeMaxX(i)-GetObjectSizeMaxX(1),0,50+kk)
		  kk=kk+50
	  endif
	next

	for i= 1 to 1000
		MoveObjectLocalY(i,GetObjectSizeMaxY(i))
		MoveObjectLocalz(i,GetObjectSizeMaxz(i))
	next
	
	`ceiling
	for i= 1001 to 2000
	  CreateObjectBox(i,GetObjectSizeMaxX(i-1000)*2,2,GetObjectSizeMaxz(i-1000)*2)
	  setobjectposition(i,getobjectx(i-1000),1+GetObjectSizeMaxY(i-1000)*2,getobjectz(i-1000))
	  r=getobjectcolorred(i-1000)/2
	  g=getobjectcolorgreen(i-1000)/2
	  b=getobjectcolorblue(i-1000)/2
	  SetObjectColor(i,r,g,b,255)
	next
	
endfunction





Posted: 6th Jan 2022 11:36
@:Rich Dersheimer-nice one, reminds me of an early game I typed in at the age of 12 from popular weekly magazie (which I still have in the loft), think it was called arrow man or something like that.
Posted: 17th Jan 2022 5:45
@chafari thanks for participating. It gives the feel that you are in a city, nice job dude. I'm still busy with my 'ball blast' game, so I couldn't write a code this time.
Posted: 17th Jan 2022 7:40
Thanks mate. If anyone would like to continue this thread feel free to set a new challenge.

Cheers.
Posted: 17th Jan 2022 22:52
nice city gen, chaf

sorry i didn't put anything together for the challenge. i had an idea that proved to be more time-consuming than anticipated...