Mio Jackpot
| | A jackpot game with sound effects and hi-score.


Right click to close. |
Try miojackpot.exe
| | You can download and try the application. This application is a prototype and some features may not work as expected on your computer.
|
| |
| File | miojackpot.exe |
| Size | 578 Kb |
| Platform | Windows 98, ME, NT4, 2000, XP, Vista |
|
|
|  |
Download Source Code
| | The full source code is provided as a Mio Archive File. With MioFactory, you can open this archive file, edit the source code and test the result.
|
| |
| File | miojackpot.mioa |
| Size | 96 Kb |
| Format | MioFactory Archive File |
|
|
| |
MioScript Source Code| | MioScript is a scripting language aimed to create any kind of applications. A free version of MioFactory is available to compile MioScript applications. |
function.Scroll:Initialize()
&iScroll = draw.mem.createFromFile(path.rsc("Scroll.jpg"))
draw.&iScroll.copyFrom.&iScroll(0,0,27, 156, 0, 156, 27, 156)
&ScrollA = window.main.create(true, Scroll, false, false, false, false)
window.&ScrollA.pos.now(39, 90,26, 51)
&ScrollB = window.main.create(true, Scroll, false, false, false, false)
window.&ScrollB.pos.now(71, 90,26, 51)
&ScrollC = window.main.create(true, Scroll, false, false, false, false)
window.&ScrollC.pos.now(103, 90,26, 51)
draw.&ScrollA.copyFrom.&iScroll()
draw.&ScrollA.paint()
draw.&ScrollB.copyFrom.&iScroll()
draw.&ScrollB.paint()
draw.&ScrollC.copyFrom.&iScroll()
draw.&ScrollC.paint()
function.end
function.Scroll:Start()
&TargetA = num.random(0, 5) + 10
&TargetB = num.random(0, 5) + 20
&TargetC = num.random(0, 5) + 30
&aPos = 0
&aTotalPos = 0
&bPos = 0
&bTotalPos = 0
&cPos = 0
&cTotalPos = 0
doEvent.ScrollA()
doEvent.ScrollB()
doEvent.ScrollC()
sound.play(path.rsc("roll.wav"), true)
function.end
event.ScrollA
Var.Inc(aPos, 3, 156, 0)
Var.Inc(aTotalPos, 3)
draw.&ScrollA.copyFrom.&iScroll(0,&aPos, 26, 51, 0, 0)
draw.&ScrollA.paint()
if(&aTotalPos < &TargetA * 26 + 10)
doEvent.ScrollA(10)
if.end
event.end
event.ScrollB
Var.Inc(bPos, 3, 156, 0)
Var.Inc(bTotalPos, 3)
draw.&ScrollB.copyFrom.&iScroll(0,&bPos, 26, 51, 0, 0)
draw.&ScrollB.paint()
if(&bTotalPos < &TargetB * 26 + 10)
doEvent.ScrollB(10)
if.end
event.end
event.ScrollC
Var.Inc(cPos, 3, 156, 0)
Var.Inc(cTotalPos, 3)
draw.&ScrollC.copyFrom.&iScroll(0,&cPos, 26, 51, 0, 0)
draw.&ScrollC.paint()
if(&cTotalPos < &TargetC * 26 + 10)
doEvent.ScrollC(10)
if.else
FinishGame()
if.end
event.end
function.FinishGame()
Sound.Stop()
if(&aPos = &bPos && &bPos = &cPos) // Win
Sound.&Sound.Play(path.rsc("Win2.mp3"))
Var.inc(CurrentScore, 10)
Light.Flash()
if.else
if(&aPos = &bPos || &bPos = &cPos || &aPos = &cPos)
Var.Inc(CurrentScore, 2)
Sound.&Sound.Play("Win1.mp3")
Light.Flash()
if.else
// Lost...
Sound.&Sound.Play(path.rsc("Lost.mp3"))
if.end
if.end
Score()
function.end
|
function.Bumper:Initialize
&iBump = draw.mem.createFromFile(path.rsc("bump.jpg"))
&iBumpOver = draw.mem.createFromFile(path.rsc("bumpOver.jpg"))
&iBumpDown = draw.mem.createFromFile(path.rsc("bumpDown.jpg"))
&Bump = window.main.create(true, Bumper, false, false, false, false)
window.&Bump.pos.now(60, 150, 87, 90)
mouse.&Bump.Cursor(hotspot)
draw.&Bump.copyFrom.&iBump()
function.end
event.mouse:Enter:Bumper
PaintBumper(&iBumpOver)
event.end
event.mouse:Exit:Bumper
PaintBumper(&iBump)
event.end
event.mouse:down:Bumper
PaintBumper(&iBumpDown)
Light.On()
event.end
event.mouse:up:Bumper
if(mouse.&Bump.IsOverWindow() = true)
PaintBumper(&iBumpOver)
Scroll.Start()
if.else
PaintBumper(&iBump)
if.end
Light.Off()
event.end
function.paintBumper(&Image)
draw.&Bump.copyFrom.&Image()
draw.&Bump.paint()
function.end
|
function.Light:Initialize
&iLight = draw.mem.createFromFile(path.rsc("light.jpg"))
Light.Off()
function.end
function.Light:On
draw.main.copyFrom.&iLight(0,46,46,46, 169, 92, 46, 46)
draw.main.paint()
function.end
function.Light:Off()
draw.main.copyFrom.&iLight(0,0,46,46, 169, 92, 46, 46)
draw.main.paint
function.end
function.Light:Flash()
&Flash = 6
doEvent.Flash
function.end
event.Flash
Light.On()
doEvent.FlashOff(200)
event.end
event.FlashOff
Light.Off()
var.dec(Flash)
if(&Flash > 0)
doEvent.Flash(200)
if.end
event.end
|
event.load
extern.close("{APP_NAME}") // Only one instance allowed
app.init("{APP_ID}", "{APP_NAME}", "{APP_VERSION}", "{APP_BUILD}", "{CREATE_LOG}")
&CurrentScore = 0
&MaxScore = reg.readValue(null, "score", 0)
&Sound = sound.channel.create(path.rsc("win1.mp3"))
// Shape
window.main.pos.now(250, 150)
window.main.shape.load(path.rsc("JackShape.bmp"))
window.main.image.load(path.rsc("Jackpot.jpg"))
app.booster(true)
Bumper.Initialize()
Scroll.Initialize()
Score.Initialize()
Light.Initialize()
event.end
event.terminate
sound.stop()
reg.writeValue(null, "score", &MaxScore)
event.end
|
function.Score:Initialize()
&iNum = draw.mem.createFromFile(path.rsc("num.jpg"))
Score()
function.end
function.Score()
if(&CurrentScore > &MaxScore)
&MaxScore = &CurrentScore
if.end
DrawNumber(63, 33, &CurrentScore)
DrawNumber(63, 8, &MaxScore)
draw.main.paint()
function.end
function.DrawNumber(&X, &Y, &Number)
for(&ptr, 0, 4 - str.len(&Number))
draw.main.copyFrom.&iNum(0,0,13,16, &ptr*13+&X, &Y)
for.next
&startX = (4 - str.len(&Number)) * 13 + &x
for(&ptr, 0, str.len(&Number))
&cNum = str.sub(&Number, &ptr, 1)
draw.main.copyFrom.&iNum(0,16*&cNum,13,16, &ptr*13+&StartX, &Y)
for.next
function.end
|
In the same topic
|