Forum Replies Created
-
AuthorPosts
-
OK, thanks.
LOL! Why not combine the two of them and create space cyborg dinosaurs, this reminds me of some 80s cartoons btw.
Which program do you use? I have been using Blender for many years.
Nice job! I will try it. How to install it though?
I extracted the folder and placed it here: C:\Users\cocon\.vscode\extensions
Then I set the m2.path value in the settings.json.
When I open a file I see no syntax highlight, then when I try to debug a file I can see the Monkey2 build system, but when I select it I get this message: command ‘m2.debug.startSession’ not found
Are 3D sprites same as a 3D object?
However you will have to apply a rotation to look at the camera all the time.
Nice find! I will definitely try it.
For example if I have this simple example, can I use reflection to bypass the Select statement?
Monkey123456789101112131415161718192021222324252627282930313233343536373839#Import "<std>"Using std..Global script := New String[]("CreatePlayer", "CreateEnemies", "Loop")Class EntityField Name:StringMethod New(name:String)Name = nameEndEndFunction Main()Local entities := New List<Entity>Print("Starting script.")For Local s := Eachin scriptSelect sCase "CreatePlayer"Print("Creating a player.")entities.Add(New Entity("Player"))Case "CreateEnemies"For Local i := 1 Until 10Print("Creating an enemy.")entities.Add(New Entity("Enemy " + i))NextCase "Loop"Print("Updating the game.")For Local loop := 0 To 10' doing the normal game loopNextEndEndPrint("Script ended.")EndNote that this is the most simple example you can get, writing a full interpreter will need more work.
If Monkey treated datatypes as objects you would do this:
Monkey123456Function Add(a:Object, b:Object)EndFunction Main()Add(10, 10.0)EndBut now you might try this:
Monkey1234567891011121314151617181920212223Class AddOperationPublicFunction Add:Variant(a:Variant, b:Variant)' if a is int and b is int thenReturn Add(Cast<Int>(a), Cast<Int>(b))' endReturn NullEndPrivateFunction Add:Int(a:Int, b:Int)Return a + bEndEndFunction Main()Print(AddOperation.Add(10, 10))EndHowever if is possible to automate anything Reflection I would be interested to learn how is done.
From what I see, I can open a file from command prompt nicely, but the monkey2 compiler can’t figure out the location of the file. I wonder if it’s related to the reason that monkey can’t load full-paths as well.
Yeah, it rocks!
I have faced a practical use case with reflection in C#, to have the runtime system read the static type system and make some creative uses out of it, for example one real benefit is to avoid silly boilerplate code and gain some dynamism in this side.
For example if you have this:
C#1234interface IExample ...class FirstExample : IExample ...class SecondExample : IExample ...class ThirdExample : IExample ...You can iterate the class names (that implement the interface) and store them to a string list, and present them to the user, once you enter the name of the class you want, you can search the class by name and initialize it right away. This technique is used in some programming frameworks where having to manually maintain the descriptions of 100 examples is not a wise choice.
Where?
This is amazing! I want to learn about this old school pixel art style, are there any good tutorials?
Yeah from what I have experienced if you go for radians you will have to reference the PI a lot, which is not an exactly user friendly way.
For example
0
Pi = 180
Pi * 2 = 360Another way is to have extension methods and have the alternative option of feeding either degrees or radians.
camera.RotateRadians(Pi, 0, 0)I had created a camera class once in OpenTK, if you are interested I can offer the source.
However all of my interest would be to create a “Transform” class first and let the camera have a transform property instead.
Perhaps I would go for ultrawide monitor soon, I hope that it would work as well with Monkey2.
-
AuthorPosts