Elian Script trainer.

I am working with another programmer and we are creating a "mini game" of sorts.
Its a very simple premise.
Elian script is an english alphabet cypher, the goal is to press the corresponding letter when the symbol comes on the screen.

Code:
(function() {

    var Alias_createUpperLayer = Spriteset_Map.prototype.createUpperLayer;
    Spriteset_Map.prototype.createUpperLayer = function() {
        Alias_createUpperLayer.call(this);




        this.names = ['!Flame','!Door1','!Door2','Actor1'] ;
        this.index = 0;
        this.time = 0;
        var bitmap = ImageManager.loadSkunk('!Flame');
        this.sprite = new Sprite(bitmap);
        this.addChild(this.sprite)
    };

    var Alias_update = Spriteset_Map.prototype.update;
    Spriteset_Map.prototype.update = function() {
        Alias_update.call(this);

        this.time ++;

        if (this.time > 60) {
            this.time = 0;
            this.index = Math.randomInt(this.names.length);

        }

        this.sprite.bitmap = ImageManager.loadSkunk(
            this.names[this.index]
        )

    }


    ImageManager.loadSkunk = function(filename, hue) {
        return this.loadBitmap('img/skunk/letters/', filename, hue, true);
    };


})();



function Scene_LetterGame() {
    this.initialize.apply(this, arguments);
}

Scene_LetterGame.prototype = Object.create(Scene_Base.prototype);
Scene_LetterGame.prototype.constructor = Scene_LetterGame;

(function($) {

    $.initialize =function() {

    }


})(Scene_LetterGame.prototype);

I am using random images for the time being in place of the actual letter images im going to create for the project.
My next step is creating the system that allows the player to effect things.
Using an array for the letters, but from there im pretty stuck if anyone can offer any help.
i dont understand all , but if this can help you for player interaction, you will need to add EventListener

PHP:
        document.addEventListener('mousedown', yourFunction.bind(yourVariable));
        document.addEventListener('mousemove', yourFunction.bind(yourVariable)) ); // not need , but can be usefull
        document.addEventListener('mouseup', yourFunction.bind(yourVariable)) );
In a nutshell, each symbol has a corresponding letter of the alphabet, similar to a pigpen cypher.
The goal of the game is to train yourself to memorize these symbols.
So when the symbol beside the A appears, you need to press A on the keyboard in order to advance and get a point.

Image_13.gif
oki, well, like i say, you will need to use event listener for mouse control.
ideally it would be better to store your obj and element in a global variable, and then add these element (addChild) to the right place in rmmv.
After use listener to easy target and bind your global variable element.
Im confused lol I dont plan on using any mouse, its all going to be on the keyboard.
Unless im misunderstanding your point.. sorry im still new to scripting.
Im confused lol I dont plan on using any mouse, its all going to be on the keyboard.
Unless im misunderstanding your point.. sorry im still new to scripting.
ok no problom,
for keyBoard only , you need use the Class Input from rmmv , To get all possible static Method from Input class, tape this in the console debug:(F8)
PHP:
console.dir(Input);
unfortunately I can not guide you anymore, because I am not expert with the keyboard keys in rmmv, my project uses only mouse.
But this class that will help you.

console.dir will give you acces to static & all method & props avaibles for keyboard in rmmv.
also try to check this tread if you start js in rmmv.
https://forums.rpgmakerweb.com/inde...it-source-files-for-plugin-development.47361/
good luck
@+
Ya ive figured out I can do an array for each letter, then use a var or this variable to call each letter for the image.
The tricky part is making this work as a game.
As of right now, the image comes on screen and the math.random effect calls a random number between them and produces a random image.
Ultimately I need it to wait for key input, and only change to the next image AFTER you have hit the right key.
I appreciate your guidance 😀

Original thread: https://forums.rpgmakerweb.com/threads/elian-script-trainer.86850/