MV Snake arcade in RMMV

Hello,
so I'd like to learn more in RMMV by creating arcade snake, that would be just events following each the previous one and with possibility to create another. I'm able to use javascript tho I haven't found any great tutorial or documentation on how the events can be created - easiest way I found would be just to create map where player would never get to and create bunch of events there - it's possible but to be honest, I'm at least interested if it would be possible to make it a little more automatic.

I'm pretty sure that this engine is really not made for such game, tho it's game that should be possible to make in any game engine. (after all, it was even made in excel using vb macros)

What I would like is maybe some great guide for more expert use of scripting, maybe creating pluggins.

Thanks in advance just for reading this.

Edit:
I have here some stuff I discovered... not sure if I'm on right way, wrong, or just doing it in bad way...
let event = {id: 2, name: "SnakeHead", note: "", pages: [], x: 1, y: 1}; event.meta = {__proto__: event.__proto__}; let id = $dataMap.events.push(event) - 1; $dataMap.events[id].pages = [{ conditions: { actorId: 1, actorValid: false, itemId: 1, itemValid: false, selfSwitchCh: "A", selfSwitchValid: false, switchId: 1, switchValid: false, switch2Id: 1, switch2Valid: false, variableId: 1, variableValid: false, variableValue: 0, }, directionFix: false, image: { characterIndex: 1, characterName: "Monster", direction: 2, pattern: 1, titleId: 0 }, list: [{ code: 355, indent: 0, parameters: ["console.log('Hello world!')"] },{ code: 0, indent: 0, parameters: [] }], moveFrequency: 3, moveRoute: {list:[{code: 0, parameters: []}], repeat: true, skippable: false, wait: false}, moveSpeed: 3, moveType: 0, priorityType: 1, stepAnime: false, through: false, trigger: 1, walkAnime: true }]; $gameMap._events[id] = new Game_Event($gameMap._mapId, id);
only problem is, that the event is not visible or doesn't do anything visual (image nor audio), except that it works
@Shaz, seems like I can't delete messages, just moved contents from here to first post, if you want, you can delete this, Thanks for warning me about this.
Double-post notice: @don1stream
Welcome!

Your post really doesn't explain to me what you're trying to do. The first post is very stream of thought, and then the second is this long JavaScript function that I'm not going to try to proofread much not knowing what it's supposed to do 😛

I Googled the words in your title and saw that Snake Arcade is a game where you're just automatically moving forward and eating things and getting longer as you go. I don't really see why you would necessarily need any JavaScript for most of that.

You should be able to use parallel events to force the character to continuously move in the direction they're facing, then I'd use an event spawning plugin to add events behind the player with parallel triggers to move toward the event in front of them. I suppose you could write your own code instead of using an existing event spawner, but that seems inefficient.

As far as your code goes, I don't get why you're trying to add events to the database during play. I should think you'd be trying to work everything through the $gameMap.

And, of course, you're correct - RPG Maker is really not designed to create anything like this, so you're definitely trying to dig through concrete with a spoon 😛 It's like saying you're going to test your new grill by making ice cream.

Good luck!
Thanks, you got it right, I was trying to make event spawning plugin. It was not necessarly behind the player but that's not important, where it will be.

The reason I was adding it to database - I was digging trough code that was already in project - mostly rpg_objects.js. I think the reason that they are not visible has to do something with sprite database, but I'm not really sure. I was too tired to get that part.

edit:
So yea, found some event spawner, but it required the additional map, so I decided to finish it myself... it took time (aproximetly 6 hours) and still needs tweaks (at this moment it works with timeout >_<) but it's done - creates an event with any custom parameter I want and it's visible 😀 I'm not exactly sure what I did, but apparently rpg maker is not gratefull for adding stuff during game - especially manager, so I just added data, than reloaded map and added data again... tho I learned quite a lot and can imagine some stuff I could use this for 😀

Original thread: https://forums.rpgmakerweb.com/threads/snake-arcade-in-rmmv.155044/