Author Topic: Arcane Cracktro Remake + Purebasic Source Code  (Read 4644 times)

0 Members and 1 Guest are viewing this topic.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 978
  • Karma: 258
    • View Profile
Hi guys!

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

Pad  ;)

Code: [Select]
;##########################################################################################
;# 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:

Offline energy

  • Amiga 1200
  • ****
  • Posts: 280
  • Karma: 25
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #1 on: January 20, 2012 »
nice one!   :D
coding: jwasm,masm
hobby: www.scd2003.de

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #2 on: January 20, 2012 »
Good One :)

Offline Pot Noodle

  • Sponsor
  • Amiga 1200
  • *******
  • Posts: 271
  • Karma: 15
  • Computers have lots of memory but no imagination
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #3 on: January 21, 2012 »
Thanks for sharing, This will help me get to grips with Pb  :goodpost:

Offline ttemper

  • Atari ST
  • ***
  • Posts: 209
  • Karma: 7
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #4 on: January 21, 2012 »
nice one padman.

thanks for sharing the source code also.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 978
  • Karma: 258
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #5 on: January 22, 2012 »
 :) @ all.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1150
  • Karma: 174
    • View Profile
    • Raizor's Dev Blog
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #6 on: January 22, 2012 »
Groovy :)
raizor

Challenge Trophies Won:

Offline Kirl

  • Senior Member
  • Pentium
  • ********
  • Posts: 1200
  • Karma: 230
    • View Profile
    • Homepage
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #7 on: January 23, 2012 »
Nice, cool font! :clap:
www.kirl.nl
Challenge Trophies Won:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #8 on: January 24, 2012 »
 :clap:

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

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 978
  • Karma: 258
    • View Profile
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #9 on: January 26, 2012 »
Cheers guys!  :)

Code: [Select]
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:

Offline jace_stknights

  • Amiga 1200
  • ****
  • Posts: 399
  • Karma: 32
  • PEEK & POKE are not MOVEM!
    • View Profile
    • ST Knights WebSite
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #10 on: January 27, 2012 »
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:

Offline va!n

  • Pentium
  • *****
  • Posts: 1398
  • Karma: 108
    • View Profile
    • http://www.secretly.de
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #11 on: March 14, 2012 »
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:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4380
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Arcane Cracktro Remake + Purebasic Source Code
« Reply #12 on: March 14, 2012 »
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: