For March - we could try developing something like
Outrun
Chase HQ
Both work on the same road engine except CH doesnt split roads
// Project: TurboRun
// Created: 2019-01-25
// show all errors
SetErrorMode(2)
#constant screenwidth=1024
#constant screenheight=768
#constant fullscreen=0
#constant screenrate=0
// set window properties
SetWindowTitle( "TurboRun" )
SetWindowSize( screenwidth, screenheight, fullscreen )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( screenwidth, screenheight ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( screenrate, 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
global angx#,angy#,startx#,starty#
land=CreateObjectPlane(1000,1000)
SetObjectRotation(land,0,0,0)
SetObjectColor(land,0,100,0,255)
road = CreateObjectBox(100,1,1000)
SetObjectRotation(road,90,0,0)
SetObjectColor(road,200,200,200,255)
roadleftsplit = CreateObjectBox(50,1,1000)
SetObjectRotation(roadleftsplit,90,0,0)
SetObjectColor(roadleftsplit,200,200,200,255)
SetObjectVisible(roadleftsplit,0)
car = CreateObjectBox(20,20,10)
x#=Get3DVectorXFromScreen(screenwidth/2,screenheight)
y#=Get3DVectorYFromScreen(screenwidth/2,screenheight)
z#=Get3DVectorZFromScreen(screenwidth/2,screenheight)
SetObjectPosition(car,x#,y#-400,z#)
img = createtexture()
SetImageWrapU(img,1)
SetImageWrapV(img,1)
SetObjectUVScale(img,0,1000,1000)
SetObjectImage(road,img,0)
camerax#=0
cameray#=-450
cameraz#=-13
SetCameraRotation(1,-90,0,0)
startx#=screenwidth/2
starty#=screenheight/2
speed#=0
velocity#=0
miles#=0
do
inc speed#, velocity#
inc miles#, speed#
if velocity#<0 then velocity#=0
if velocity#>.0400 then velocity#=0.0400
if GetRawKeyState(38)
inc velocity#,.0001
else
dec velocity#,.0001
endif
if GetRawKeyState(37) then dec camerax#,.05
if GetRawKeyState(39) then inc camerax#,.05
SetObjectPosition(car,getcamerax(1),getobjecty(car),getobjectz(car))
SetObjectUVOffset(road,0,0,-speed#/100)
print("Miles : " + str(miles#))
SetCameraPosition(1,camerax#,cameray#,cameraz#)
movecamera()
Print( ScreenFPS() )
Sync()
loop
function movecamera()
if GetPointerState()=1
fDiffX# = (GetPointerX() - startx#)/4.0
fDiffY# = (GetPointerY() - starty#)/4.0
newX# = angx# + fDiffY#
if ( newX# > 89 ) then newX# = 89
if ( newX# < -89 ) then newX# = -89
SetCameraRotation(1, newX#, angy# + fDiffX#, 0 )
endif
endfunction
function createtexture()
swap()
for y=0 to 128 step 4
DrawBox(42-2,y,42+2,y+1,MakeColor(255,255,255),MakeColor(255,255,255),MakeColor(255,255,255),MakeColor(255,255,255),1)
DrawBox(85-2,y,85+2,y+1,MakeColor(255,255,255),MakeColor(255,255,255),MakeColor(255,255,255),MakeColor(255,255,255),1)
next
render()
img = GetImage(0,0,128,128)
endfunction img