Sie sind hier: Startseite » Literature

Random Code Excerpt

A random Selection of GFA-Basic Gamecode

PROCEDURE labstep(feldx&,feldy&,direction&)

__LOCAL thisfeldx&,thisfeldy&,nextdir&,i|,go!

__thisfeldx&=feldx&+nextx&(direction&)

__thisfeldy&=feldy&+nexty&(direction&)

__go!=TRUE

__SELECT direction&

__CASE 0

____IF BTST(horwall&(feldx&,feldy&),6) AND BTST(horwall&(feldx&,feldy&),0)

______go!=FALSE

____ENDIF

__CASE 1

____IF BTST(vertwall&(feldx&+1,feldy&),6) AND BTST(vertwall&(feldx&+1,feldy&),0)

______go!=FALSE

____ENDIF

__CASE 2

____IF BTST(horwall&(feldx&,feldy&+1),6) AND BTST(horwall&(feldx&,feldy&+1),0)

______go!=FALSE

____ENDIF

__CASE 3

____IF BTST(vertwall&(feldx&,feldy&),6) AND BTST(vertwall&(feldx&,feldy&),0)

______go!=FALSE

____ENDIF

__ENDSELECT

__IF lab&(thisfeldx&,thisfeldy&)=-1 AND go!

____IF curvydur&=0

______setcurvy

____ELSE

______DEC curvydur&

____ENDIF

____SELECT direction&

____CASE 0,2

______sethorwall(thisfeldx&+wallx&(opposit|(direction&)),thisfeldy&+wally&(opposit|(direction&)),FALSE)

____CASE 1,3

______setvertwall(thisfeldx&+wallx&(opposit|(direction&)),thisfeldy&+wally&(opposit|(direction&)),FALSE)

____ENDSELECT

____nextdir&=RANDOM(4+curvy&)

____IF nextdir&>3

______nextdir&=direction&

____ENDIF

____labstep(thisfeldx&,thisfeldy&,nextdir&)

____FOR i|=0 TO 3

______IF i|<>nextdir& AND i|<>opposit|(direction&)

________labstep(thisfeldx&,thisfeldy&,i|)

______ENDIF

____NEXT i|

__ENDIF

RETURN

Cookies are used for the operation of the website. This website does not intend to collect your data. But third party media is embedded in this website (youtube, vimeo,...)These third party providers might collect data outside the influence of this website.