Author Topic: Paradox Fucktro remake + Purebasic Source code  (Read 19402 times)

0 Members and 1 Guest are viewing this topic.

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Hi guys!

Well, this is what it says in the topic.  ;D It's not picture perfect, especially the scroller (it ends and starts again, the original loops endlessly, hope you get what I mean  :xmas:). I couldn't be bothered to add that since this isn't Retro Remakes. (It's available in all it's glory there anyway...) But hey, you got the source, feel free to add that feature and post the code!  ;)

Enjoy!

Pad :)

Code: [Select]
;##########################################################################################
;# Yet another quick and crap cracktro remake by Padman. (c)06/2011                       #
;# Libminifmod170 by rbz is used for music replay.                                        #                                       
;# Out of laziness I also used a slightly tweaked sine scroller routine by Shockwave,     #
;# which can be found here: http://www.dbfinteractive.com/forum/index.php?topic=1436.0.   #
;########################################################################################## 






Global  xres.w , yres.w , loop.w ,xp.w , yp.w , t.s , tptr.w , sco.b

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

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



InitSprite()                     
InitKeyboard()                 
   

Dim gfxfont(60)               
         
 

window = OpenScreen( xres , yres , 16 , "Paradox Fucktro")     

If window = 0                                           
  MessageRequester("Error", "This is fucked up, I can't open the window", 0)       
  End                                                   
EndIf



font = CatchImage (#PB_Any, ?font)   

StartDrawing (ScreenOutput())                         
  DrawImage (ImageID(font),0,0)                       
StopDrawing()

xp = 0
yp = 0





For loop =1 To 60                                     
  gfxfont(loop) = GrabImage(font,#PB_Any,xp,yp,31,31)   
  xp = xp + 32                                         
  ;                                                   
  If xp > = 320
    yp = yp + 32
    xp = 0
  EndIf
Next



CatchSprite(0,?one)
CatchSprite(1,?two)
CatchSprite(2,?three)
CatchSprite(3,?foot)
CatchSprite(4,?logo) 




  MiniFmod_Init(?mod,?endmod-?mod)
  MiniFmod_Play()

Repeat
 
  timer = ElapsedMilliseconds()   
  ClearScreen($0)                                       
  ExamineKeyboard()                                     




AnimDelay + 1
 
   
             If AnimDelay = 7
                  AnimDelay = 0
   
   
             
                AnimFrame + 1
                EndIf
      If AnimFrame = 3 : AnimFrame=0 : EndIf     




  StartDrawing (ScreenOutput())                       
    cco = 0
   

 
    For cc = 0 To 30
      letter = (Asc(UCase(Mid(t.s, tptr+cc, 1)))-31)
      DrawImage (ImageID(gfxfont(letter)), 310+300*-Sin((sco+cco)/180), 270+160*Cos((cco+sco)/180))
      cco = cco + 42
    Next
   
   
    sco = sco -2
   
    If sco < -32
      tptr = tptr + 1
      sco=sco + 42
    EndIf
   
   

   
    If tptr > (Len(t.s)-30)
      tptr = 1
    EndIf
  StopDrawing()                                       


DisplayTransparentSprite(animframe,128,97)
DisplaySprite(3,(640-SpriteWidth(3))/2,386)
DisplayTransparentSprite(4,(640-SpriteWidth(4))/2,0)



 TimeGap = TimerDuration - (ElapsedMilliseconds() - Timer)

  If TimeGap > 16
 
    Delay( TimeGap - 10 )
  EndIf




  FlipBuffers()                                       

Until KeyboardPushed (#PB_Key_Escape)               

 MiniFmod_Stop()
 MiniFmod_Free()

End

DataSection
one:  IncludeBinary "prd1.bmp"
two:  IncludeBinary "prd2.bmp"
three: IncludeBinary "prd3.bmp"
foot: IncludeBinary "foot.bmp"
font: IncludeBinary "font.bmp"
logo: IncludeBinary "logo.bmp"
mod: IncludeBinary "angels.xm"
endmod:
EndDataSection

                 
[Edit]

jace_stknights pointed out to me that:

Code: [Select]
StartDrawing (ScreenOutput())                         
  DrawImage (ImageID(font),0,0)                       
StopDrawing()

isn't needed. He's of course right. You can grab an image without displaying it first, other than Grabsprite(), where you have to display the sprite. So feel free to delete that part! ;)



     
   

 
   
« Last Edit: June 20, 2011 by padman »
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #1 on: June 17, 2011 »
Very good

It seem to me that it is your Purebasic framework of making Demo :) ;)

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #2 on: June 17, 2011 »
Thanks! :)

I wouldn't call that mess a framework though. It's just how my PB sources look like. Init stuff, load sprites, main loop, datasection...  ;)
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #3 on: June 17, 2011 »
Crashes for me Padman :(
Get a black screen, which switches back to the desktop then about 3 seconds of audio and then it crashes out:

"pdx.exe has stopped working"
raizor

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #4 on: June 17, 2011 »
Oopsie daisy. What OS are you on? It's probably that stone old zoomsprite function. :whack: I'll look into it, though I get no errors in the debugger here and it runs just fine.



[Edit]:  I removed the zoomsprite routine. It wasn't really needed anyway and if I remember correctly I already had problems with that once. New zip is in the first post. Hope it'll work now (though my AV complains about the UPX(?) packed file...  ::)) Anyway, I don't spot any other oddities in the code.
« Last Edit: June 17, 2011 by padman »
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #5 on: June 17, 2011 »
Oopsie daisy. What OS are you on? It's probably that stone old zoomsprite function. :whack: I'll look into it, though I get no errors in the debugger here and it runs just fine.



[Edit]:  I removed the zoomsprite routine. It wasn't really needed anyway and if I remember correctly I already had problems with that once. New zip is in the first post. Hope it'll work now (though my AV complains about the UPX(?) packed file...  ::)) Anyway, I don't spot any other oddities in the code.

Same as before I'm afraid. I'm on Win 7 x64.
raizor

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #6 on: June 17, 2011 »
Have you tried to run the file in XP compatibilty mode? This is really strange, I don't see anything special that could cause the problem.  :telloff:
Challenge Trophies Won:

Offline KrazyK

  • Amiga 1200
  • ****
  • Posts: 390
  • Karma: 131
    • View Profile
    • KrazyK Remakes
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #7 on: June 17, 2011 »
Same error here on Win7 x64, but I've ran the code supplied and it it appears to be the screen depth of 32 that was causing the errors. 
Changing it to 16 works fine.

Code: [Select]
window = OpenScreen( xres , yres , 16 , "Paradox Fucktro")     
Or

Windowed mode:
Code: [Select]
;window = OpenScreen( xres , yres , 16 , "Paradox Fucktro")
window = OpenWindow(99,0,0,xres,yres,"",#PB_Window_ScreenCentered|#PB_Window_WindowCentered|#PB_Window_BorderLess)
OpenWindowedScreen(WindowID(99),0,0,xres,yres,0,0,0)
ShowCursor_(0)

I've attached the windowed one here.

[Edit] Attached the fullscreen version now.   16bit depth 8 bit colour gfx.
« Last Edit: June 17, 2011 by KrazyK »
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #8 on: June 17, 2011 »
Thanks for testing (and fixing) it mate! K+  :)
That's a strange problem though.  Must be a Purebasic bug that only shows on x64 systems then. I mean a screen depth of 32 is more common these days than 16 isn't it?!? Or maybe it has to do with the fact that the used BMPs are mixed 2/8/24bit? Don't understand why it's working on XP then without any problems. I'm confused. Anyway, thanks again!


[Edit:] I attached a file with a screen depth of 32bit, where all bmp's are 24bit. Would be nice if someone of you x64 guys could test it and tell me if that cures the problem too!
[Edit:] File removed, working binary and source in first post.
« Last Edit: June 18, 2011 by padman »
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #9 on: June 17, 2011 »
[Edit:] I attached a file with a screen depth of 32bit, where all bmp's are 24bit. Would be nice if someone of you x64 guys could test it and tell me if that cures the problem too!

KrazyK's version works for me. Same problem with this new one Padman.
raizor

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #10 on: June 17, 2011 »
Crap, thanks for testing! I wouldn't have had a chance to find it out myself without you guys! I don't understand it, but from now on I'll use a 16bit screen for x64 systems compatibility then... Fixed code & zip file in first post.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #11 on: June 17, 2011 »
Excellent!

Amazingly I don't think this cracktro even exists on Retro-Remakes and it must be one of the most famous of all.
Thanks for sharing it with us, K+
Shockwave ^ Codigos
Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #12 on: June 17, 2011 »
Thanks for the Karma!  :)  It does exist on RR since 2010 (and as a 1:1 version unlike this one  ;D) But yeah, it took some time until Stormbringer remade it...  ;)
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #13 on: June 17, 2011 »
Lol I hadn't seen the 1:1 - This will do for me anyway :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #14 on: June 18, 2011 »
Cool, K++ for sharing sources!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #15 on: June 18, 2011 »
Thanks!  :)
Challenge Trophies Won:

Offline Dr.Death

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 445
  • Karma: 9
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #16 on: June 20, 2011 »
My all time fav m8 thanx for the code... :updance:
Proud member of DAWN

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #17 on: June 20, 2011 »
Hehe, yw!  :)
Challenge Trophies Won:

Offline neumanix

  • ZX 81
  • *
  • Posts: 10
  • Karma: 3
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #18 on: June 22, 2011 »
Nice one!
I was amazed at how effective the UPX compressor is. I compiled in v4.51, got an exe of 1.55MB and UPX shrunk it to 60Kb.
How did you get it to 47Kb btw? Older version of PB?

Offline padman

  • Senior Member
  • Pentium
  • ********
  • Posts: 990
  • Karma: 260
    • View Profile
Re: Paradox Fucktro remake + Purebasic Source code
« Reply #19 on: June 22, 2011 »
Thanks!
I used PB 4.41, but I think that doesn't really matter.  It's probably because of the UPX settings I used. I don't remember them exactly, but I remember having used compression level "best". Most of the 1.55MB is caused by the 24bit pics anyway and BMPs are usually crunched at a pretty good ratio.
« Last Edit: June 22, 2011 by padman »
Challenge Trophies Won: