• Welcome to Dark Bit Factory & Gravity.
 

Arcane Cracktro Remake + Purebasic Source Code

Started by padman, January 20, 2012

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

padman

Hi guys!

Compiled with PB 4.41. Feel free to do whatever ever you want with it...

Pad  ;)

;##########################################################################################
;# 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.b


IncludeFile "scroll.pbi"                             
IncludeFile "libminifmod170.pbi"


xres  = 640           
yres  = 480           
sco   = 0
tptr  = 1
FPS = 60
TimerDuration = 1000 / FPS



;#### Setup Starfield

#STARS = 100
#MAX_SPEED = 8.1


Structure Stars
x.f
y.f
Speed.f
Shade.l
EndStructure
Dim 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)\Speed
Next



;#### Init stuff, Sprite3D is used for zooming

InitSprite()                     
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 it

CreateSprite(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 it

CatchSprite(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 logo

DisplaySprite3D(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!
End

DataSection
font: IncludeBinary "font.bmp"
logo: IncludeBinary "arcane.bmp"
mod: IncludeBinary "return_of_egic.xm"
endmod:
EndDataSection
Challenge Trophies Won:

energy

coding: jwasm,masm
hobby: www.scd2003.de


Pot Noodle

Thanks for sharing, This will help me get to grips with Pb  :goodpost:

ttemper

nice one padman.

thanks for sharing the source code also.

padman

Challenge Trophies Won:

Raizor

raizor

Challenge Trophies Won:

Kirl

www.kirl.nl
Challenge Trophies Won:

jace_stknights

 :clap:

Still making remakes????  shame on me :boxer:
Challenge Trophies Won:

padman

Cheers guys!  :)

Still making remakes?

Not really mate, I had some sparetime and was a little bored. Stormbringer's version is on RR since ages already...   ;)
Challenge Trophies Won:

jace_stknights

Hum... yep but you did it! not me  :boxer:

I will do my best to finish the Empire intro soon, just have to make the sinewave scroll... about 10 min of code  :-[
Challenge Trophies Won:

va!n

Nice one and thanks for sharing the source ;)
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

benny!

Ooops ... totally missed this thread. Well done! And K++ for sharing the source!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: