Forum Replies Created
you can use libc.sizeof() to get the size of a variableMonkey12345678910111213141516Namespace myapp#Import "<std>"Using std..Function Main()Local b:BoolLocal i:IntLocal l:LongPrint libc.sizeof(b)Print libc.sizeof(i)Print libc.sizeof(l)End
On my mac machine it returns 1,4,8. So bool is one byte here…
Too bad, I get some glitchy gfx with my Mac Book Air Mid 2013… (IntelHD 5000)
The emscriptem works (at 7FPS) on the same machine though.
Looks nice, will try to play on my W10 machine!May 22, 2018 at 6:10 am in reply to: Raycast Solutions, does MX2 have anything like this? #14679
you can do it with box2d too.
box2d is not in the form of a module now but it works fine.. the module should be there soonish.
just download the box2d fork and build these to see it working:
Edit: you are looking for a non imort solution so therevils’ code should be better!
Lambdas have access to the local variables, so you avoid writing all the parameters too..
The basics for me are:
-your main loop is actually the OnRender() Method. If you open a mojo template you could do a game by adding some Fields and adding code to OnRender() only, you would usually use the New() method to initialize your things though.
-your drawing operation are made with “Canvas” (DrawText,DrawImage,…), Onrender(canvas) receives a “canvas” for you to draw things.
-using the keyboard constant let you check for keyboard inside OnRender()
-using the Mouse constant let you check for Mouse inside OnRender()
So the basic instruction are the methods provided by
-mojo.input.KeyboardDevice (type of the “Keyboard” global)
-mojo.input.MouseDevice (type of the “Mouse” global)
You should read the “the mojo module” section in the manual (unfold in treeview to see all of it’s content)
and open a mojo template and play with it (File>Templates>Simple mojo App).
There is a freshly new beginner video on how to draw an image (by abe-king): https://streamable.com/39izl
sorry was a bit off mx2 last days…
But great! Welcome to the docs community!
Do you plan to write specific things (so we don’t work on the same ones..)?
There must be a way to reset the fork without loosing the issues…?
EDIT: just saw your rebase, looks neat! Isn’t that enough for a clean pull request?
REEDIT: just saw Mark’s message and everything seems to be all right (and even better with a rebase)
Well I’ve done it all wrong till now and Mark has merged some pull requests full of «dev up». So for the last pull request I actualy made a clean fork on my account and the closed the issues on the mx2docsCommunity fork.
I must say I’m a bit surprised it is so complicated to keep a branch sync and clean.
Anyway, do as you think it’s better. My way to do it is completely wrong probably. Nerobot had suggested somewhere how to do it cleanly (in a pull request discussion I think).
If it is possible to create a new branch that is a clean copy of brl’s dev that would be neat. But how to sync mx2docsCommunity master(or dev) with brl’s dev in a clean way?
As you can see I’m more using github like a dropbox than like a git ;).
@arpie, invited you as owner. If you are used to git cli, it would be great if you could sqash all the “dev up” commits into one commit, so it doesn’t pollute brl’s repo when making a pull request. Can you do that? I’ve been looking a for it a bit but I never used the cli..
there is a github orgnization
the fact that class funcs are not documented is in the issues.
You can help improving docs via that fork or with your own github..
If you want admin rights in mx2DocsCommunity just ask..
I’ve had been working a bit on the language ref. but have just a few spare time now so focused on my game project.
i3-3110 (laptop) 4GB and running smooth.
Monkey2 on the other hand ouputs some wasm or asmjs compiled by emscriptem. Monkey2 is a more advanced language in term of oop design.