Code: Select all
/****************************************************************
** **
** Name: Prodigy Cracktro "Aladdin" **
** Author: Mr.X of Barracuda **
** Version: 1.1 **
** Date: 13.05.17 **
** Interpreter: Hollywood 6.0 **
** Licence: Sample program for Hollywood **
** **
** History: **
** **
** 1.1: (13.05.17) **
** **
** - adapted for RebelSDL **
** **
** 1.0: (14.05.05) **
** **
** - initial release **
** **
****************************************************************/
/*
** Important! Check if the used Hollywood version is at least
** version 6.0!
*/
@VERSION 6,0
@REQUIRE "rebelsdl", {Link = True, RenderDriver = "rpi"}
/*
** This script requires the RebelSDL plugin
*/
@REQUIRE "rebelsdl"
@BRUSH 5, "Logo.png", {Transparency = $421021}
@BRUSH 6, "font.png"
@MUSIC 1, "vision.mod"
@SAMPLE 1, "yeayea.wav"
@DISPLAY {Width = 720, Height = 520, Color = $211021}
/* initialize the cracktro font */
Function p_InitFont()
Local x, y, k, nx, y
CreateBrush(7, 584 * 2, 16)
SelectBrush(7)
; perform a hard-scale on the font so that every char has 16x16 pixels
For y = 0 To 7
For k = 0 To 1
nx = 0
For x = 0 To 583
DisplayBrushPart(6, x, y, nx, ny, 1, 1)
DisplayBrushPart(6, x, y, nx + 1, ny, 1, 1)
nx = nx + 2
Next
ny = ny + 1
Next
Next
EndSelect
SetBrushTransparency(7, #BLACK)
; for shadow text
CopyBrush(7, 8)
ReplaceColors(8, {#WHITE, #BLACK})
EndFunction
/* create a lookup table for our font */
Function p_InitText()
Local f$ = " !'()*+-./:ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"
chars = {}
For Local x = 0 To 72
chars[Asc(MidStr(f$, x, 1))] = x * 16
Next
Local t$ = {
" CRIME IS ART !\n\n" ..
" AND ART IS CRIME !\n\n" ..
"WHAT WE WANNA TELL YOU :\n\n" ..
" THAT WAS A RHYME !",
" * PRODIGY *\n\n" ..
" CRACKED FOR URE PLEASURE:\n\n" ..
" ALADDIN from VIRGIN! * FINAL! *\n\n" ..
"--------------------------------------\n" ..
"GAME SUPPLIED BY : * SUX! *\n" ..
"GAME CRACKED BY : * HITPOINT *\n" ..
"--------------------------------------\n" ..
" * RELEASED ON 20/11/94 ! *",
" * INTRO CREDITS *\n\n" ..
"--------------------------------------\n" ..
"CODING BY : * ALPHA1! *\n" ..
"ADDITIONAL CODING: * SIRIAX! *\n" ..
"DESIGN BY : * SIRIAX! *\n" ..
"GRAFIX BY : * SIRIAX! *\n" ..
"MUSIC BY : * LAXICAL *\n" ..
"--------------------------------------\n\n" ..
"THIS RELEASE IS DEDICATED TO * NOSCHY *\n\n" ..
"PRODIGY - WE ARE LIKE...COOL AND STUFF!"}
texts = {}
texts[0] = StrToArray(t$[0])
texts[1] = StrToArray(t$[1])
texts[2] = StrToArray(t$[2])
EndFunction
/* create the background pic plus shift effect */
Function p_InitBG()
Local v = {}
Local k
; setup polygon with 24 spikes
For k = 0 To 23
v[i] = k * 32
v[i+1] = 15
v[i+2] = k * 32 + 16
v[i+3] = 0
v[i+4] = (k + 1) * 32
v[i+5] = 15
i = i + 6
Next
v[i] = 0
v[i+1] = 15
SetFillStyle(#FILLCOLOR)
; create bgpic
CreateBrush(3, 720, 520, $211021)
SelectBrush(3)
Box(0, 86, 720, 348, $421021)
DisplayBrush(5, 96, 180)
EndSelect
BrushToBGPic(3, 2)
DisplayBGPic(2)
; create upper spikes
CreateBrush(3, 32 * 24, 16, $211021)
SelectBrush(3)
Polygon(0, 0, v, i + 1, $421021)
EndSelect
; create lower spikes
CreateBrush(4, 32 * 24, 16, $421021)
SelectBrush(4)
Polygon(0, 0, v, i + 1, $211021)
EndSelect
CreateClipRegion(1, #BOX, 0, 86, 720, 348)
EndFunction
/* creates a new text object */
Function p_MakeText()
Local t = texts[ct]
Local k, maxchrs, lines = 0, 0, 1
Local chrs, x, y = 0
; calculate width & height of the texts
While t[k] <> 0
If t[k] = 10
If chrs > maxchrs Then maxchrs = chrs
chrs = 0
lines = lines + 1
Else
chrs = chrs + 1
EndIf
k = k + 1
Wend
If chrs > maxchrs Then maxchrs = chrs
ypos = (348 - lines * 22) \ 2 + 86
ypos2 = ypos
textw = maxchrs * 16 + 6
texth = lines * 22
CreateBrush(9, textw, texth, #RED)
SelectBrush(9)
k = 0
; render text + shadow to the brush
While t[k] <> 0
If t[k] = 10
x = 0
y = y + 20
Else
DisplayBrushPart(8, chars[t[k]], 0, x + 6, y + 10, 16, 16) ; shadow
DisplayBrushPart(7, chars[t[k]], 0, x, y, 16, 16) ; text
chrs = chrs + 1
x = x + 16
EndIf
k = k + 1
Wend
EndSelect
SetBrushTransparency(9, #RED) ; make it transparent
; wrap to next text object
ct = Wrap(ct + 1, 0, 3)
Switch ct
Case 1:
accel = accel - 3 * 2.75
Case 0:
accel = accel - 2 * 2
Case 2:
accel = accel - 0.5
EndSwitch
CreateSprite(1, #BRUSH, 9)
EndFunction
/* move text objects in and out of the screen */
Function p_SwitchText()
If rev = False
ypos2 = ypos2 + accel
accel = accel + 2.75
If ypos2 >= 452
p_MakeText()
rev = True
ypos2 = 450
EndIf
Else
ypos2 = ypos2 - accel
accel = accel - 2.75
If accel < 2 Then accel = 2
If ypos2 <= ypos
StartTimer(1)
accel = 3
rev = False
ypos2 = ypos
EndIf
EndIf
DisplaySprite(1, #CENTER, ypos2)
EndFunction
/* prepare cross-fade */
Function p_PrepareExit()
If exit = True Then Return
CreateBrush(10, 720, 520)
SelectBrush(10)
DisplayBrush(5, 96, 180)
EndSelect
BGPicToBrush(2, 11)
SelectBrush(11)
DisplayBrush(3, x1, 70)
DisplayBrush(4, x2, 434)
EndSelect
RemoveSprite(1)
SetClipRegion(0)
exit = True
EndFunction
/* check if ESC was pressed */
Function p_CheckKey(msg)
If msg.key = "ESC" Then p_PrepareExit()
EndFunction
/* this function is called 25 times per second */
Function p_MainLoop()
; are we in exit mode?
If exit = True
; phase 0: fade out bg!
; phase 1: fade Prodigy to white
; phase 2: fade Prodigy to black
Switch phase
Case 0:
CopyBrush(10, 12)
MixBrush(12, 11, 255 - ratio)
DisplayBrush(12, 0, 0)
ratio = ratio + 5
If ratio = 270 Then phase = 1
Case 1:
CopyBrush(5, 10)
TintBrush(5, #WHITE, 255 - ratio)
DisplayBrush(5, 96, 180)
ratio = ratio - 5
If ratio = 165
StopMusic(1)
PlaySample(1)
EndIf
If ratio = 0 Then phase = 2
Case 2:
CopyBrush(5, 10)
TintBrush(5, #BLACK, ratio)
DisplayBrush(5, 96, 180)
ratio = ratio + 5
If ratio = 255
WaitSampleEnd(1)
Wait(50)
End
EndIf
EndSwitch
Else
;refresh the display
SetClipRegion(0)
DisplayBrush(3, x1, 70)
DisplayBrush(4, x2, 434)
SetClipRegion(1)
If GetTimer(1) > 4000
p_SwitchText()
Else
DisplaySprite(1, #CENTER, ypos)
EndIf
If IsLeftMouse() = True Then p_PrepareExit()
x1 = x1 - 4
x2 = x2 + 4
If x1 = -32 Then x1 = 0
If x2 = 0 Then x2 = -32
EndIf
EndFunction
p_InitText()
p_InitFont()
p_InitBG()
x2 = -32
InstallEventHandler({CloseWindow = p_PrepareExit, OnKeyDown = p_CheckKey})
p_MakeText()
StartTimer(1)
PlayMusic(1)
accel = 3
; endless loop
Repeat
p_MainLoop
CheckEvent
Forever