Discord
Login
Community
DARK THEME

Should microScript have a upgrade to 3.0?

There has been no upgrades for microScript for 4 years, I was wondering like maybe have more key words enhancing game dev experience? Or make some changes to make it better? Here is what I got let me know if these are good ideas!

const, declare a read only value:

In 2.0, a variable like Gravity = 9.8 looks the same as any other variable, nothing stops you from accidentally overwriting it later. const marks a value as permanently fixed. Trying to reassign it raises a clear error message instead of silently breaking your game. (This fixes some super annoying bugs)

Here is a example:

// These look like normal vars
// Nothing stops accidental changes
Gravity = 9.8
Max_Speed = 300
Tile_Size = 16

// Oops silent bug
Gravity = 0

Instead something like this:

// Locked forever
const Gravity = 9.8
const Max_Speed = 300
const Tile_Size = 16

// Error: cannot reassign a const
Gravity = 0

is, readable type checks:

myvar.type == "number" is wordy and easy to misspell. The new is keyword turns this into a simple sentence. Works with all built in types: number, string, list, object, function. Also works with class names.

In 2.0 be have to do something like this everytime:

if val.type == "number" then
  print("it's a number")
end

if val.type == "list" then
  print(val.length)
end

if val.type == 0 then
  print("not defined")
end

Instead have a is keyword do the trick:

if val is number then
  print("it's a number")
end

if val is list then
  print(val.length)
end

if val is undefined then
  print("not defined")
end

// Works with classes too
if enemy is Boss then
  playBossMusic()
end

How are these? Maybe comment your opinions or ideas? Let me know! :)

At the moment i believe he is rather busy with his game he has been working on. Also to best reach him use the discord.

Yes, I agree with you, Tiberius. One of the things I'd like Microstudio to have is more console functionality. For example, being able to read inputs from there, instead of using system.input, which I don't like because it creates pop-ups.
Like this:

system.read(function(input)
  if input == "op" then
    player.op()
  end
end)

Or more highlighting, like when you call a function
Or instead of when you use the console to see the properties of, for example, lists. Instead of using the docs to see the properties of the lists, you could type list on the console and put the properties of the lists.
Or string templates, like:

John = object
  name = "John"
  age = 15
end

sayHello = function(name, age)
  print(`Hi, my name is {name}, and im {age} years old`)
end

sayHello(John.name, John.age)
//Output: "Hi, my name is John, and im 15 years old"

Or optional type annotation like:

john: string = "John"
age: number = 15
isMinor: bool = false

fruits: list[string] = ["Apple", "Banana", "Grappes"]
Milly: object[string, number] = object
  name: string = "Milly"
  age: number = 18
end

add: number = function(a: number, b: number)
  return a + b
end

Yes great idea challcrot however changing microScript's easy to use syntax into the ones you gave makes it way harder to write code in my opinion, but great idea!

And AJiscool I will go on discord soon about that! :)

I suggest that what you suggested about readable file types you should please make it into more Tiberscript code as it fits with the clean and smooth vibes.It’s an idea

I mean TiberScript is my language, and it is super clean, I just wish I could help gilles put it here in microStudio it would be awesome!

But yes I do think that microScript does need readable files like TiberScript! :)

im not ready for the change if my game was set to microscript 3.0 it would break

well it isn't happening yet because gilles has to make the changes and announce it to make it happen

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community