Logic World Wednesdays: Labels & Grids
View this post on logicworld.net
Label UI - Jimmy
Labels are blocks with editable text on them. I added them to Logic World a while ago, but there hasn’t been an in-game way of editing them. This week I finally added that menu, as well as the ability to change the labels’ color!
Grid Placing - Jimmy
Grid Placing is a new feature that lets you quickly place many components in a grid.
One of my goals with Logic World is to make the building mechanics fast and easy to use, and Grid Placing is a big part of that!
C# to JS - Felipe
I'm finally back from vacation! Unfortunately I'm going to have less time for LW stuff as I'll be busy with school, however this week I did have time to add something to my vue-aspvalidate library: as you may remember from my last LWW section in order to, say, validate an email there has to be a snippet of C# code that validates it in the back-end and a snippet of JS that validates it on the front end, which meant writing duplicate code for each kind of validation. This is obviously less than ideal as you’re writing everything twice, so I set on to find a way to take C# code and translate and send it to the client.
I arrived at a solution using the wonderful LINQ Expression
s API in C# that lets you pass a method a lambda (i.e. value => value.Length > 10
) and then go through it using an ExpressionVisitor
, which lets you see the lambda as a regular C# object of a type derived from Expression
. For example, the previous example would call the VisitBinary
method on your visitor, which in turn lets you visit the left and right sides of the >
operator and so on.
This means that a single-line validator like value => value[2] == ‘@’ && value.StartsWith(“lol”) || Regex.IsMatch(value, “.*?%$”)
gets translated to the JS code value => value[2] == “@” && value.startsWith(“lol”) || new RegExp(“.*?%$”).test(value)
. As you can see, some BCL methods get translated to their JS counterparts, allowing me to write complex validators without worrying about writing any JS code!
If you’d like to receive an email each time we post one of these blogs, you can sign up for our newsletter. Be sure also to join the official Discord.
See you next Wednesday!
Get Logic World
Logic World
Build. Program. Simulate. A 3D, first-person circuit simulator in a bright and colorful world.
Status | In development |
Author | Mouse Hat Games |
Genre | Simulation, Puzzle |
Tags | circuit, Co-op, First-Person, logic, Moddable, Multiplayer, Sandbox, Singleplayer, the-ultimate-nerd-game |
Languages | English |
Accessibility | Configurable controls |
More posts
- Logic World v0.91.3 is now available!Mar 22, 2024
- Logic World v0.91.2 is now available!Dec 20, 2023
- Logic World v0.91.1 is now available!May 12, 2023
- Logic World v0.91 is now available!Dec 21, 2022
- Logic World Wednesdays: Season PremierFeb 10, 2022
- The Logic World Original Soundtrack is now available to stream and download!Feb 05, 2022
- Logic World v0.90.3 is now availableNov 24, 2021
- Logic World v0.90.2 is now availableNov 20, 2021
- Logic World v0.90.1 is now availableOct 30, 2021
- Hey by the way the game came out!Oct 24, 2021
Leave a comment
Log in with itch.io to leave a comment.