Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
Hello i remade one of my script from ace a SpaceShip minigame, you control a spaceship with up and down(or mouse) throught a tunnel

//=============================================================================// SpaceShipMinigame.js// Free for commercial use//=============================================================================/*:* @plugindesc SpaceShipMinigame v.1.0* @author Zarby** @param Score Variable ID* @desc Score is stored in this variable when gameover* @default 10** @param Lives* @desc How many live the player have* @default 3** @param HoleSize* @desc Define the size of the hole for the spaceship* @default 10** @param HoleRandom* @desc more higher this value is more it create straight tunnel* @default 2** @param ScrollSpeed* @desc speed of the view* @default 4*/function Scene_SpaceMinigame() { this.initialize.apply(this, arguments);}Scene_SpaceMinigame.prototype = Object.create(Scene_Base.prototype);Scene_SpaceMinigame.prototype.constructor = Scene_SpaceMinigame;Scene_SpaceMinigame.prototype.initialize = function () { Scene_Base.prototype.initialize.call(this);};Scene_SpaceMinigame.prototype.create = function () { Scene_Base.prototype.create.call(this); //#--------------------------------------------------------------------------- //# Images Generation uri, you can change images here by using a image to uri //#--------------------------------------------------------------------------- //Font Bitmap Data 256x40; this.fontdata = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAAoCAYAAAAR+iSJAAAGzElEQVR4nO1a27YiOwj02/1xz8s4E2koqoCofezwMKa5FQWm415ze9zeKM/1zpyXXHJJKO9N92fd7/eH9/w6HC75CVFnnbG3C+kWGy6RfR7s7\ /d7/EU26+8hoPpOktVtzDdL1LOsRrJ/ZT3KqeRQ/bv4h/tyv9+PL0LSL4252hqdteEIsMnR3gMa2ENfoC8TNaE/i4AhCHlcVtQ/1z/QwxkIsL4MabU31q6IH/GD8mb68mxF/qDezMcHnzXPSeCt8MBYxMZAJxhFYGbT0a+sHRk82nxKyH4dDmRPl8Vj9hEGties\ DZO7it/wBOcD+GZ+L6vCA1nbMYVZNoE9lV/2q8/ymX0DeFcTzxcWDrDS5InNcvMIOLcJGoKAS8i/5RT5RxwEM0Jx5i2ld9Yvyw/wwBt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AAAAAQ3J\ lYXRlZCB3aXRoIEdJTVBkLmUHAAABKUlEQVQ4y6WTPW7CQBCFv/VsQ+NbpEOpIrmgCQdIwzUooM0JtoXC13DjA5iGwhJVRJdbWEI0NpNis2YdQHLESivNz87Tm/e0RouaZ44BFECL2phF1sdjARKAKgezyHS7vsb/YqB1yu7QMF/Cdu0bq804JgnA7tDw/pZS5X\ 7w9cUDjWGSaFGb+dInASTkY9ZJQrA7NAOQ1Qa+vkdoEGw0i0y1Tq+NrHk4FGuThOGYRaAP4ERwIgCcugun7nKzljoRdSL660h/qxwFtLRWAd2fW92fWz11F/+2qLF/6cUs4uNEmE0s+3M7qPcAU2NwIsyX3c3wUbXvzyb2PsBH65FLaznq0LnPrsOJMDWG0tr+b\ VB0oEOsR3zjepV7rQAd2PjIqnv9/gM++51/APquqcGRJtvwAAAAAElFTkSuQmCC";};Scene_SpaceMinigame.prototype.start = function () { Scene_Base.prototype.start.call(this); var vparameters = PluginManager.parameters('SpaceShipMinigame'); this.lives = Number(vparameters['Lives'] || 3); this.sendvar = Number(vparameters['Score Variable ID'] || 10); this.holesize = Number(vparameters['HoleSize'] || 10); this.holerand = Number(vparameters['HoleRandom'] || 2); this.scrollspeed = Number(vparameters['ScrollSpeed'] || 4); this.startFadeIn(this.fadeSpeed(), false); this.screenbit = new Bitmap(424, 312); this.score = 0; var text = this.score.toString() + ' '; var xp = 0; var yp = 0; this.mapdir = 1; this.mapi = []; this.lastdir = 0; this.gameover = false; this.scoretimer = 0; for (i = 0; i < 54; i++) { this.mapi = 16; } var fbit = Bitmap.load(this.fontdata); var scorebit = new Bitmap(text.length * 8, 16); fbit.addLoadListener(function () { for (i = 0; i < text.length; i++) { for (j = 33; j < 122; j++) { var c = text.charCodeAt(i); if (c == j) { var x = (j - 33); var y = Math.floor(((j - 33) / 32)); x = x - (y * 32); scorebit.blt(fbit, x * 8, y * 13, 8, 13, xp + (i * 8), yp); break; } } } }); this.screensprite = new Sprite(this.screenbit); this.screensprite.scale = new Point(2, 2); this.addChild(this.screensprite); this.scoresprite = new Sprite(scorebit); this.scoresprite.x = (816 / 2) - (text.length * 8)/2; this.scoresprite.y = 4; this.addChild(this.scoresprite); this.shipsprite = new Sprite(Bitmap.load(this.spaceshipdata)) this.shipsprite.scale = new Point(2, 2); this.shipsprite.x = 8; this.shipsprite.y = 312; this.addChild(this.shipsprite);};function padzero(n, p, c) { var pad_char = typeof c !== 'undefined' ? c : '0'; var pad = new Array(1 + p).join(pad_char); return (pad + n).slice(-pad.length);}Scene_SpaceMinigame.prototype.update = function () { var active = this.isActive(); $gameTimer.update(active); $gameScreen.update(); if (this.gameover == false) { this.scoretimer += 1; if (this.scoretimer >= 10) { this.score += 1; this.scoretimer = 0; } this.screensprite.x -= this.scrollspeed; if (this.screensprite.x <= -16) { var cdir = Math.floor(Math.random() * this.holerand) this.mapdir = Math.floor(Math.random() * 3); this.mapi = this.mapi.slice(1, this.mapi.length); if (cdir == 1) { this.lastdir = this.mapdir; if (this.mapi[this.mapi.length - 1] <= 3) { this.mapi.push(this.mapi[this.mapi.length - 1] + 1) } else if (this.mapi[this.mapi.length - 1] >= 30) { this.mapi.push(this.mapi[this.mapi.length - 1] - 1) } else if (this.mapdir == 0) { this.mapi.push(this.mapi[this.mapi.length - 1]); } else if (this.mapdir == 1) { this.mapi.push(this.mapi[this.mapi.length - 1] - 1); } else if (this.mapdir == 2) { this.mapi.push(this.mapi[this.mapi.length - 1] + 1); } } else { if (this.mapi[this.mapi.length - 1] <= 3) { this.mapi.push(this.mapi[this.mapi.length - 1] + 1) } else if (this.mapi[this.mapi.length - 1] >= 21) { this.mapi.push(this.mapi[this.mapi.length - 1] - 1) } else if (this.lastdir == 0) { this.mapi.push(this.mapi[this.mapi.length - 1]); } else if (this.lastdir == 1) { this.mapi.push(this.mapi[this.mapi.length - 1] - 1); } else if (this.lastdir == 2) { this.mapi.push(this.mapi[this.mapi.length - 1] + 1); } } this.screensprite.x = 0; } if (Input.isPressed('up')) { this.shipsprite.y -= 3; } if (Input.isPressed('down')) { this.shipsprite.y += 3; } if (TouchInput.isPressed()) { if (TouchInput.y > this.shipsprite.y) { this.shipsprite.y += 3; } if (TouchInput.y < this.shipsprite.y) { this.shipsprite.y -= 3; } } //check collision if (this.shipsprite.y + 4 <= this.mapi[1] * 16) { this.gameover = true; //collision } if (this.shipsprite.y + 32 >= this.mapi[1] * 16 + (this.holesize * 16)) { //collision this.gameover = true; } var text = padzero(this.score, 6, '0') + ' x' + padzero(this.lives, 2, '0'); var fbit = Bitmap.load(this.fontdata); var scorebit = this.scoresprite.bitmap; fbit.addLoadListener(function () { scorebit.fillAll('#000000'); for (i = 0; i < text.length; i++) { for (j = 33; j < 122; j++) { var c = text.charCodeAt(i); if (c == j) { var x = (j - 33); var y = Math.floor(((j - 33) / 32)); x = x - (y * 32); scorebit.blt(fbit, x * 8, y * 13, 8, 13, 0 + (i * 8), 0); break; } } } }); this.screenbit.fillAll('#8B4513'); for (i = 0; i < 54; i++) { this.screenbit.fillRect(i * 8, this.mapi * 8, 8, this.holesize * 8, '#3C1E05') } } else { if (Input.isTriggered('cancel')) { SceneManager.goto(Scene_Map); } if (Input.isTriggered('ok') || TouchInput.isTriggered()) { if (this.lives > 1) { this.scoretimer = 0; for (i = 0; i < 54; i++) { this.mapi = 16; } this.shipsprite.y = 312; this.gameover = false; this.lives -= 1; } else { $gameVariables.setValue(this.sendvar, this.score); SceneManager.goto(Scene_Map); } } } Scene_Base.prototype.update.call(this);};

How to use it just call a script from an event :

SceneManager.goto(Scene_SpaceMinigame)Preview :

 
Last edited by a moderator:

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,318
Reaction score
824
First Language
English
When I went to click on your preview, my computer freaked out, and I had this red warning/web-page, and whenever I tried to click out of it, it kept refreshing the page. Couldn't even close my browser without force closing it via the system. Might be the website you're hosting that preview on or something...
 

Valast

Programmer in Training
Member
Joined
May 24, 2015
Messages
11
Reaction score
0
First Language
English
Oh, I never clicked the preview of this. I thought I'd test the plugin out but wanted to see what you meant. 
 

Zarby

Veteran
Veteran
Joined
Dec 16, 2012
Messages
42
Reaction score
25
First Language
French
Primarily Uses
hum, i don't know at all why lol i always use this site to upload my screenshot it only a preview image .png :o anyways the script is text only... , i'll probably upload preview on youtube later anyway
 

Valast

Programmer in Training
Member
Joined
May 24, 2015
Messages
11
Reaction score
0
First Language
English
I tried it out. It works as you intended, a very simple minigame. Good job.
 
Last edited by a moderator:

XyonSxT

『 Le Stranger 』
Member
Joined
Nov 2, 2015
Messages
7
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
Awesome!

But here is not any form to adjust the screen size? Because i'm using YEA - Core resolution change and it views like this...

11uxmci.jpg
Very good work!
 

topar395

Veteran
Veteran
Joined
Nov 10, 2015
Messages
44
Reaction score
15
First Language
English
Awesome Stuff!! Took me waaaaay back. I see it is marked as v1.0 Do you have a newer version in the making or plans for one? Because I could see shooting down other ships and picking up people as an option. Thank you very much for your hard work and the nostalgia.
 

SecondRogers

Warper
Member
Joined
Apr 4, 2016
Messages
3
Reaction score
0
First Language
Spanish/Español
Primarily Uses
Hello!


How can I use this?


Sory for the dumb question...
 

ragnawind

Veteran
Veteran
Joined
Jun 3, 2012
Messages
180
Reaction score
5
First Language
English
Primarily Uses
Hello!


How can I use this?


Sory for the dumb question...

Since it isn't already a JS file and just plain text on the website, you should just have to highlight all the text in the window and paste it into a blank Notepad document and save it is SpaceShipMinigame.js. Then, copy it to your project's js/plug-ins folder and load it up in the Plug-ins Manager for your game. Then, just use the specified script call to bring it up in-game
 

dante101

Villager
Member
Joined
Aug 25, 2016
Messages
8
Reaction score
3
First Language
English
Primarily Uses
so...I have a problem..I just can't call the scene out ,even through I was doing the right way to plug the js and set the event and script right,but still nothing happen,is there


any necessary js file I should install?


ps:my mv version is 1.0.1
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
33,716
Reaction score
8,498
First Language
German
Primarily Uses
RMMV
the biggest problem is probably that the forum update a few month back broke the code tags, making all scripts or plugins into one-liners.


You can't copy that script and expect it to run as-is, you need to add in the correct line breaks to make it functional again.


And that is difficult unless you're a programmer, and tedious if you are...
 

dante101

Villager
Member
Joined
Aug 25, 2016
Messages
8
Reaction score
3
First Language
English
Primarily Uses
the biggest problem is probably that the forum update a few month back broke the code tags, making all scripts or plugins into one-liners.


You can't copy that script and expect it to run as-is, you need to add in the correct line breaks to make it functional again.


And that is difficult unless you're a programmer, and tedious if you are...

and I am afraid I am not a programmer 


so...it looks like I should give up this JS...
 

Latest Threads

Latest Profile Posts

I'm tempted to leave the Fight/Escape choice in the Boss Battle submission and make Escape pop up Nedry from Jurassic Park: "Uh uh unh!"
Is it weird that i feel overwhelmed from reading codes that i wrote few months ago? Lol.

I dont even know where to continue!:hsad:
Ami
Gosh,I want to Play this Game Again one more again!

Seeing my Own Character & Kannono Once Again!
Tales_of_the_World_Radiant_Mythology_3_JPN_PSP-Coverart.jpg
I've been a bit to depressed to get work done on the game lately. Don't worry, I'll be okay.

Forum statistics

Threads
115,306
Messages
1,088,797
Members
149,951
Latest member
abishanth
Top