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

I will suggest that for the extended classes in microscript 3.0 the objects from the parent class should be called as

Example
(x,y) of parent

Instead of

super(x,y)

And there should be a camera object by default which is like screen but with special properties

Example
draw = function()
 camera.clear()
 camera.follow(player.x,player.y)
 camera.follow_method("ease_in",0.7)
 camera.drawSprite("icon", player.x, player.y, 20, 20)
end

Yes that is a good idea I think that microScript 3.0 should have more default functions/objects already in the system like camera, collision types, and more.

And I honestly like the super(x,y) it is fast and easy to use

I think for microstudio 3.0 it would need to have these new features

  1. After exporting to exe (which should be added to offline version) it should be able to read and know the folders and documents in the directory where the exe is. This would be great if we want to create a big game.

Also maybe some FX for 2d in graphics api, like glow, fire, wind, and they should work by applying lineary like this

screen.setGlow(color,intensity, inner/outer)

screen.setFire(color,intensity)

screen.drawSprite(.....)

screen.clearEffects()

this is for applying the FXs to the rendered Sprite and clearing so that it doesnt affect other rendered parts.

The reason exporting to exe is only in web version is because it uses electron and thats web based

I do think there should be more functions builded in microScript 3.0 because there is only so much, and adding like what you said Nekalvi!

And yeah AJiscool I think you right about the exe export unfortunately

Post a reply

Progress

Status

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