Show your biggest scripts!

Chris24XD

  • Posts: 37
Hi!
Did you maybe want to show up your biggest codes?
Show them here!!!

Luyren

  • *
  • Posts: 2336
You should learn about lists and maps. By using them and loops, you can greatly reduce the size of that code and make it more versatile in the process.

It is also recommended you use only one of the basic events (Created, Update and Draw) per behavior.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

Chris24XD

  • Posts: 37
Well l don't often use lists and maps because l can't understand where are there useful. l've already read info about them but l still don't get it.
- Anyways, to be on topic,please give your biggest code.

merrak

  • *
  • Posts: 2620
I have some scripts that are longer than 16,000 px (in screenshot form), but I can't say I'm proud of them. When programmers want to show off their skills, they usually do the opposite--try to write code that accomplishes elaborate tasks in as few lines (or blocks) as possible. Look up "code golf" sometime.

Since you asked for long scripts, though, I'll share mine. It's the animations handler for "Rogue of Vallas". Animation handling tends to grow exponentially more complex as the number of different states increases.

This thread would probably be more interesting if we talked a little bit about what the script does, features we're proud of, lessons to share, that sort of thing.

One thing I am very glad I did with the custom block "reset animation" is add a "caller" argument. This is only used for debugging, but it prints the event that triggered the reset. This has been invaluable for debugging animation states. When something happens, the current animation often needs to be reset. As complex as the animation handling is, there is a lot of room for logic errors. Knowing which event called for an animation reset has made fixing these errors a lot easier.

« Last Edit: August 16, 2020, 12:57:21 pm by merrak »

Chris24XD

  • Posts: 37
l saw it. Awesome  :)
Also if you wonder about the big repeation in my script it's because l was bored to make more custom blocks and l was trying to make a level generator for my game, Baldi's Basics Floor Maps Demo.