0 Members and 1 Guest are viewing this topic.
;##########################################################################################;# Time for another little cracktro remake con source code by Padman. (c)01/2012 #;# I've included some very basic comments which are meant for beginners, so they can #;# easily spot where what is going on... #;# Libminifmod170 by rbz is used for music replay. # ;# And it uses Shockwave's / va!n's scroller code which can be found at: #;# http://www.dbfinteractive.com/forum/index.php?topic=1436.0 #;# The starfield might also be from some tutorial, can't really remember ;) #;########################################################################################## Global xres.w , yres.w , loop.w ,xp.w , yp.w , t.s , tptr.w , sco.bIncludeFile "scroll.pbi" IncludeFile "libminifmod170.pbi"xres = 640 yres = 480 sco = 0tptr = 1FPS = 60TimerDuration = 1000 / FPS;#### Setup Starfield#STARS = 100#MAX_SPEED = 8.1Structure Stars x.f y.f Speed.f Shade.lEndStructureDim Stars.Stars(#STARS)For i = 0 To #STARS Stars(i)\X = Random(640) Stars(i)\Y = 105+Random(288) Stars(i)\Speed = Random(#MAX_SPEED) Stars(i)\Shade = 255 / #MAX_SPEED * Stars(i)\SpeedNext;#### Init stuff, Sprite3D is used for zoomingInitSprite() InitSprite3D()InitKeyboard() ;#### Open up the DX9 screen 640x480 window = OpenScreen( xres , yres , 32 , "Arcane Cracktro Remake") If window = 0 MessageRequester("Error", "This is fucked up, I can't open the window", 0) End EndIf;#### Catch the font pic CatchSprite(1,?font,#PB_Sprite_Texture)TransparentSpriteColor(1,$000008);#### Create a sprite for our stars and paint a 2x2 box on itCreateSprite(50, 2, 2, #PB_Sprite_Texture)StartDrawing(SpriteOutput(50)) Box(0, 0, 2, 2, #White)StopDrawing()CreateSprite3D(50, 50);#### Catch the logo sprite and zoom itCatchSprite(0,?logo,#PB_Sprite_Texture) CreateSprite3D(0,0)ZoomSprite3D(0,SpriteWidth(0)*2,SpriteHeight(0)*2) ;#### Init and start the music replay MiniFmod_Init(?mod,?endmod-?mod) MiniFmod_Play() Repeat timer = ElapsedMilliseconds() ClearScreen($0) ;#### This displays the starfield Start3D() For i = 0 To #STARS Stars(i)\X + Stars(i)\Speed If Stars(i)\X > 640 Stars(i)\X = 0 EndIf DisplaySprite3D(50, Stars(i)\X, Stars(i)\Y, Stars(i)\Shade) Next ;#### This displays the Arcane logoDisplaySprite3D(0,(640-(SpriteWidth(0))*2)/2,140) Stop3D() ; #### This draws the upper and lower borders StartDrawing (ScreenOutput()) Box(0,104,640,2,#White) Box(0,392,640,2,#White) StopDrawing() ; #### This draws the scroller cco = 0 For cc = 0 To 20 letter = Asc(UCase(Mid(t.s, tptr+cc, 1)))-31 yCharPos = letter / 10 xCharPos = letter % 10 If xcharpos= 0: xcharpos = 10 : ycharpos=yCharPos-1 :EndIf If xCharPos <- 1: xCharPos = 9 ElseIf xCharPos > 0 : xCharPos = xCharPos - 1 EndIf ClipSprite(1, xCharPos*32, yCharPos*44, 32,44) DisplayTransparentSprite(1, (sco+cco),312) cco = cco + 34 Next sco = sco -4 If sco < -32 tptr = tptr + 1 sco = sco + 32 EndIf If tptr > Len(t.s)-16 tptr = 0 EndIf TimeGap = TimerDuration - (ElapsedMilliseconds() - Timer) If TimeGap > 16 Delay( TimeGap - 10 ) EndIf ExamineKeyboard() FlipBuffers() Until KeyboardPushed (#PB_Key_Escape) ;#### If [ESC] was pressed stop the music MiniFmod_Stop() MiniFmod_Free() ;#### and Adios!EndDataSectionfont: IncludeBinary "font.bmp"logo: IncludeBinary "arcane.bmp"mod: IncludeBinary "return_of_egic.xm" endmod:EndDataSection
Still making remakes?