Hi guys, I have been writing an old Amiga Arcade Style game.
But having got purspective right i am stuck with getting corners/bends, i think it's a case of offseting the scanlines
but i just can't sort it out, i have tryed to use an array for the X cords but this produces funny effects, any ideas guys
so i may carry on with it.
Thanks.
;-----------------------------------------------------------------
; Old Amiga Arcade Style Game.
;-----------------------------------------------------------------
If InitSprite()=0 Or InitKeyboard()=0 Or InitSound()=0
MessageRequester("Error","Initializing Error!",0):End
EndIf
#ScrX=800:#ScrY=600:#ScrD=32
#ScanLines=200:#WidthStep=1
#LineWidth=1:#TotalLines=599
Global Dim ZMap.l(#ScanLines)
Global ScrollSpeed=10
For B=1 To #ScanLines
ZMap(B)=B*10
Next
If OpenScreen(#ScrX,#ScrY,#ScrD,"")
SetFrameRate(60)
; background=CatchImage(#PB_Any,?back)
Offset=100
X=400
Repeat
FlipBuffers()
ClearScreen(0)
StartDrawing(ScreenOutput())
; DrawImage(ImageID(background),0,0,830,336)
ScreenLine=#TotalLines
Distance=(290)
A.f=1
While A<#ScanLines
If Mod(ZMap(Int(A))+Offset,150)>50
GrasColor=$058303
RoadColor=$3b3b3b
LineColor=$3b3b3b
SideColor=$000099
Else
GrasColor=$057204
RoadColor=$3a3a3a
LineColor=$838582
SideColor=$aaaaaa
EndIf
LineXY(X-Distance,ScreenLine,X+Distance,ScreenLine,RoadColor) ; road
LineXY(0,ScreenLine,#ScrX-X-Distance,ScreenLine,GrasColor) ; left grass
LineXY(X+Distance,ScreenLine,#ScrX,ScreenLine,GrasColor) ; right grass
; centre lines
LineXY(X+(#LineWidth-Distance*0.02),ScreenLine,X+(#LineWidth+Distance*0.02),ScreenLine,LineColor)
; red+white side lines
LineXY(X-Distance,ScreenLine,X-Distance+5.0,ScreenLine,SideColor)
LineXY(X+Distance-5.0,ScreenLine,X+Distance,ScreenLine,SideColor)
ScreenLine-1 ; decreas line/y by 1
Distance-#WidthStep ; decreas the distance one line at a time
A+A*0.02
Wend
StopDrawing()
Offset+ScrollSpeed
If Offset>=150
Offset-150
EndIf
ExamineKeyboard()
Until KeyboardPushed(#PB_Key_Escape)
EndIf
; FreeImage(background)
End
DataSection
; back:IncludeBinary "back.bmp"
EndDataSection