Microscript+
A huge extension to microscript, bringing some common (and some not-so-common) helper functions and variables, plus lots of interesting classes! https://microstudio.dev/i/JmeJuniper/msplus/
Changelog:
v2.1
3/31/2023
New
- Functions
- updmsplus()
Updated
- Functions
- map2d
- Now uses low-high values, like the regular map function, instead of defining a center and a size.
- Classes
- vec
- added .normalize()
Renamed
- Functions
- roundPlace -> roundTo
- rgbStr -> rgb
- rgbaStr -> rgba
- dist2d -> dist
- dirTo -> dir
- Classes
- vec2d -> vec
Deleted
- Functions
- numberfy (bad practice & useless, use Number.parse())
- stringify (bad practice & useless, use .toString())
- arrayify (bad practice, useless, poorly implimented, and there's another much more versatile method. (string).split(","))
- dist3d (I decided I'm not going to make a 3d library. Overally my knowledge of 3d is rudimentry at best, so I'm getting rid of this & vec3d.)
- contencate (Just... why did I make this? Same problems as arrayify. Just use (list).join(", "))
Bugfixes
- Functions
- median
- Works properly now (broke
v1.5.1
)
- Works properly now (broke
v2 hotfix 1
2/1/2023
Bugfixes
- Variables
- allX
- Now actually returns a value (broke
v2
)
- Now actually returns a value (broke
- allY
- Now returns the y value, not x value (broke
v2
)
- Now returns the y value, not x value (broke
v2
12/22/2022
This is... a huge update. I haven't worked on microscript+ very much, but I added a few features every once in a while and it built up to this. Well, it doesn't look that big, since the place where most of the content is and the place that looks the most underwhelming happen to be the same place: New.
New
- Variables
- i/imgry/imgnry/imaginary
- allX
- allY
- Classes
- complex
- Prototypes
- List
- clone
- removeIf
- Object
- clone
- removeIf
Updated
- Functions
- roundPlace
- Now rounds to the nearest multiple of
mark
, instead of rounding to the nearestplace
decimal places
- Now rounds to the nearest multiple of
- Variables
- wasdX
- Now supports more keyboard layouts
- wasdY
- Now supports more keyboard layouts
- Classes
- vec2d
- "*" now returns the dot product of two vectors, instead of multiplying magnitude.
Renamed
- Functions
- divisibleBy -> divisible
Deleted
- Classes
- vec3d
- Prototypes
- List
- remove (already a function)
- arrange (already a function)
Bugfixes
- Functions
- rand
- Now can return decimal values (broke:
v1
)
- Now can return decimal values (broke:
Misc
- Removed
msplus.
before all functions/classes/variables. - Added default parameter values to rand, chance, roundPlace, lerp, and contencate
v1.6.1
9/16/2022
New
- Functions
- map2d
Updated
- Classes
- Dynamic
- Merged addWall and updWall into one function: setWall
- touchingWall now accepts a list, and returns true if any of them are being touched
v1.6
8/31/2022
Microscript's back! I was waiting to release this because one of the features doesn't work due to a microscript bug, but I figured it's been long enough and I might as well just publish this and add a note saying it won't work until it's fixed. Anyways, because of that, it's a pretty big update :D
New
- Functions
- mod
- Prototypes
- String
- replace
- List
- arrange
- random
- remove
Updated
- Classes
- Button
- Added .press
- Added .release
- Dynamic
- Added setVar()
- Added getVar()
- Added setSprite()
- Added touchingAny()
- Dynamics now lose speed when hitting screen borders, just like when hitting walls (if clamp is on)
Deleted
- Functions
- arrange (replaced with List.arrange, as seen in New)
- randItem (replaced with List.random, as seen in New)
Misc
- Changed the few straggling
=
s in if statements to==
s
v1.5.5
7/1/2022
Updated
- Classes
- Dynamic
- Collisions now work while the dynamic is still
- Dynamics now (probably) won't teleport through walls anymore
- Dynamics can now "skim" past the sides of walls without losing (all) of their momentum
- Walls now display when debug for a dynamic is on, with an orange hitbox and an orange line linking them and their parent dynamic
- Prototypes
- String
- "*"
- Returns "" when multiplying a string by 0 or less
- Demo
- Arrows now disappear faster (allowing you to fire them quicker)
- Arrows now no longer bounce off the wall (they fall on the ground instead)
v1.5.4
6/30/2022
Updated
- Functions
- Numberfy
- Now conducts deep searches of lists. Returns first numberfiable thing it can find, numberfied
- Demo
- ? now activates help
Bugfixes
- Functions
- Numberfy
- Now works instead of returning
"540"
when inputted"54"
, for example (Broke with microstudio update)
- Now works instead of returning
v1.5.3
6/27/2022
New
- Functions
- randItem
Updated
- Functions
- arrange
- Now returns error notifying that string sorting may not be accurate with non-numbers in the array, but still returns the attempted sorted list
Bugfixes
- Functions
- arrange
- "low-high" method stops zero-ing numbers (Broke
v1.5.2 hotfix 1
(it's a really quick hotfix to repair a bug, of course there are going to be a bunch of bugs sprouting from it)
- "low-high" method stops zero-ing numbers (Broke
v1.5.2 hotfix 1
6/25/2022
Bugfixes
- Functions
- arrange
- Now properly returns the value instead of changing the variable (Broke
v1.5.2
)
- Now properly returns the value instead of changing the variable (Broke
v1.5.2
6/24/2022
Changed
- Classes
- dynamic
- Added move
- Added setAlpha
- Added changeAlpha
- draw now sets the transparency of the sprite
- Demo
- Arrow now fades when bouncing
Deleted
- Classes
- list2d
- Couldn't get it to work properly
v1.5.1 "Statistics" update
6/23/2022
New
- Functions
- arrayPercents
- mean/average
- median
- mode
- arrange
- divisibleBy
v1.5 "Undo" update
6/22/2022
New
- Functions
- chance
- roundPlace
Updated
- Classes
- Dynamic
- BindKey now allows for "forward", "backward", "turnLeft", and "turnRight" bindings (useful for top-down games)
- Added removeBinds
- .width and .height and all collision tests now reflect rotation!
- Added toggleDebug
- Added toggleClamp
v1.4.4
6/16/2022
New
- Functions
- Arrayify
Updated
- Functions
- Stringify
- Returns input if it cannot be stringified
- Numberfy
- Returns input if it cannot be numberfied
v1.4.3
6/15/2022
New
- Demo
- Highscore
- Countdown
- Help button
Updated
- Classes
- Dynamic
- Added touchingWall, it returns true if the sprite is touching a wall
- Added bindKey
- Demo
- Fixed aspect ratio
- Arrow now bounces off of wall
Deleted
- Demo
- 1 wall
v1.4.2 "Demo" update
6/14/2022
New
- Demo (Thanks @TinkerSmith for the idea!)
Updated
- Classes
- Dynamic
- Now has setPos function, which I somehow forgot about
Deleted
- Functions
- Fill
- Unnecessary,
screen.clear(color)
exists
- Unnecessary,
v1.4.1
6/14/2022
Updated
- Classes
- Dynamic
- Now has 4 new functions: colliding, addWall, updWall, getWall, deleteWall
- .update() now features wall collision
Renamed
- Functions
- fillScreen -> fill
Bugfixes
- Functions
- Fill
- Now fills the screen instead of drawing a border (broke
v1.3
)
- Now fills the screen instead of drawing a border (broke
v1.4 - "Dynamic" update
6/13/2022
New
- Classes
- countdown
- dynamic
- list2d
Misc
- Lowered chance of overwriting user-defined variables (mostly "temp") by using
local
in functions and classes
v1.3.2
6/13/2022
New
- Functions
- map
Updated
- Variables
- All dynamic variables are now updated every millisecond, as opposed to every frame
- Classes
- Optimized scrollbar and slider, removing a lot of mathematical operations in update and draw (however, it does require a bit more computing when initiating a new instance). Not anything you would notice normally, but if you for some reason need a ton of scrollbars, or have a really really weak machine, it might help.
- Scrollbar and slider now have a
progress
variable you can access, mapping the pure x/y position of the slider/scrollbar to a 0-1 range showing the progress from the starting position
- Scrollbar and slider now have a
Bugfixes
- Variables
milliseconds
andseconds
are back inside the msplus object, like they're supposed to be (Brokev1.2.2
)
- Classes
- Scrollbar and slider now actually scroll with the mouse wheel (Broke
v1.3.1
)
- Scrollbar and slider now actually scroll with the mouse wheel (Broke
v1.3.1
6/11/2022
Updated
- Classes
- Scrollbar & slider now can adjust when you scroll with a mouse wheel, with a new variable
scrollSpeed
(If scrollSpeed is negative, it will go in reverse, if scrollSpeed is 0 or not defined, it won't react at all to mouse wheel events.)
- Scrollbar & slider now can adjust when you scroll with a mouse wheel, with a new variable
- Separated scrollbar's, slider's, and button's
draw()
into bothdraw()
andupdate()
in case you want to do something like stop the button/scrollbar/slider from updating (i.e. if you are in a pause menu, and don't want to let the user press the button, but still want to draw it to the screen)
- Separated scrollbar's, slider's, and button's
v1.3 - "UI" update
6/10/2022
New
- Functions
- fillScreen
- Classes
- uiButton
- scrollbar
- slider
Updated
- Classes
- Vec2d
- Removed .attr() in favor of
.x
,.y
,.mag
, and.dir
- Removed .attr() in favor of
- Vec3d
- Removed .attr() in favor of
.x
,.y
,.z
, and.mag
- Removed .attr() in favor of
- Timer
- Removed .getTime(), in favor of
.time
- Removed .getTime(), in favor of
v1.2.2
6/10/2022
New
- Functions
- MultiPrint
- Variables
- Public
- Milliseconds
- Seconds
- Private
- StartMilliseconds
- Prototypes
- String
- "*"
Bugfixes
- Functions
- Contencate
- Works properly again (Broke
v1.1
)
- Works properly again (Broke
v1.2.1 - "Type Conversion v2" update
6/8/2022
Updated
- Functions
- Numberfy
- Now supports lists (where the first object is a valid string) and returns informative errors
- Stringify
- Now supports objects & functions (Note: Functions do not return the code you enter, they return a lower-level code filled with instructions like
STORE_LOCAL
,LOAD_LOCAL
, andFUNCTION_APPLY_VARIABLE 1
)
- Now supports objects & functions (Note: Functions do not return the code you enter, they return a lower-level code filled with instructions like
Renamed
- Functions
- angle -> dirTo
Bugfixes
- Functions
- Numberfy
- Now actually works (broke
v1.1
)
- Now actually works (broke
- Stringify
- Now works properly with numbers and lists again (broke
v1.1.1
)
- Now works properly with numbers and lists again (broke
v1.2 - "Vector Revamp" update
6/7/2022
New
- Classes
- vec3d
Updated
- Classes
- Vec2d
- Revamped, renaming .getAttr() to .attr(), massively improving
+
and-
, fixing*
to be mathematically correct, and removing/
and&
- Revamped, renaming .getAttr() to .attr(), massively improving
Renamed
- Classes
- Vec2d -> vec2d
v1.1.2
6/7/2022
Updated
- Functions
- Stringify
- Added newlines to stringify, making it clearer to read
Bugfixes
- Functions
- Stringify
- Fixed stringify returning 0 when given a class (broke
v1.1.1
)
- Fixed stringify returning 0 when given a class (broke
- Classes
- Vec2d
- Fixed Vec2d division multiplying instead of dividing (Thanks @Sebastian!) (broke
v1
)
- Fixed Vec2d division multiplying instead of dividing (Thanks @Sebastian!) (broke
v1.1.1
6/7/2022
Updated
- Functions
- Stringify
- Now supports non-MSPLUS classes (Thanks @Sebastian!)
Renamed
- Functions
- randBetween -> rand
v1.1 - "Type Conversion" update
6/6/2022
New
- Functions
- Numberfy
Updated
- Functions
- Stringify
- Reports an error when inputting an object or non MSPLUS class instead of attempting and possibly outputting weird results
- Added support for MSPLUS classes Vec2d and timer
Misc
- Simplified function & variable calling by only requiring the name of the function/variable, not requiring
.func.
or.var.
- Put classes in the msplus object to avoid overwriting
v1 - "Initial" update
6/6/2022
New
- Functions
- randomBetween
- clamp
- lerp
- sign
- dist2d
- dist3d
- angle
- stringify
- contencate
- rgbStr
- rgbaStr
- Variables
- Public
- wasdY
- wasdX
- arrowY
- arrowX
- Classes
- Vec2d
- timer