Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started by: padman on June 17, 2011
-
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 :)
;##########################################################################################
;# 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:
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! ;)
-
Very good
It seem to me that it is your Purebasic framework of making Demo :) ;)
-
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... ;)
-
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"
-
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.
-
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.
-
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:
-
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.
window = OpenScreen( xres , yres , 16 , "Paradox Fucktro")
Or
Windowed mode:
;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.
-
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.
-
[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.
-
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.
-
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+
-
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... ;)
-
Lol I hadn't seen the 1:1 - This will do for me anyway :)
-
Cool, K++ for sharing sources!
-
Thanks! :)
-
My all time fav m8 thanx for the code... :updance:
-
Hehe, yw! :)
-
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?
-
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.
-
Great!!! Thanks for sharing! :updance:
Hawk78
-
Very nice, thanks padman. I got this working on PureBasic 5.21 LTS (MacOS X - x64) by:
-removing the music mod lib (windows only I believe).
-Changing the openScreen() from 16 to 32.
-Modifying the dataSection.
main file with mods below :
;##########################################################################################
;# 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"
InitSprite()
InitKeyboard()
Dim gfxfont(60)
window = OpenScreen( xres , yres , 32 , "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)
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)
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
-
There are some nasty bugs on OSX version of Purebasic. I've tried to port some of my remake on it, but I must admit sometimes things are not running at they should...
-
I remember when I saw this released many years back on the Amiga. Thank you for the memories, excellent!
Ted.
-
:clap: :clap: :clap: I remember too ! This startro is EPIC !
Thanks for sharing it
-
music "Iruiru" by Speedhead. Re-Used/Remixed in the famous Paradox Angels Fucktro by Samplemixer
:clap: