Forum Replies Created
-
AuthorPosts
-
Cool!
Also I have been looking for the Blitz archives this week, since wasted.nz is down this site will come handy.
Another one is to have the stuff you want rendered into an image. But then apply a GLSL shader to that image to produce the effect you want.
Some links to help you with
Render To Image
Apply GLSL
https://github.com/DoctorWhoof/Mojo-Shader-TestsFor the shader search it like this: “glsl blur image” there are lots of cool images to browse.
Cool samples!
Have you rebuilt the framework?
Whatever module you insert into monkey needs to be rebuilt separately.
… there should be full steam integration out of the box
This would be considered better as a module rather than the distribution strategy.… to get everything working …
… to have proper help: Perhaps the only that could be written is a language specification that explains the concepts of the languages. But any other than that everything else is API specific, which would not make sense to explain how the mojox works or mojo (not that I would not be great, but the effort is tremendous). Another approach is if someone is interested to write a book and sell it perhaps would boost the ecosystem.
… one click distribution: Is this related to multi-compilation? For example you want to press a button and build everywhere? This would be tricky since Monkey is tied to specific compiler toolchain in each OS.
… proper project management: From what I know nerobot has plans to work on project management for ted2go, but this will be according to his powers and effort, also it would be a conceptual thing related to the IDE only, since the compiler is by default inclusion based. Unless you can think the creation of a system as cmake for monkey.
I did an update to the original first post to get rid of the directions regarding the raw git command set, since GUI applications are much more useful and the process of working repositories is streamlined. Also the title of the post is renamed to include various tips and tricks generally regarding to building and contributing to monkey2.
One upcoming post would be to mention ways about compiling monkey2 with MSVC2017, if anyone has tried it can do a post here.
Another one is to clone and sync the repository from github-to-github (without involving your client).
Since I do not use Steam, I could not say for sure if is a good idea. However the point is that there should be a reasonable ROI (since Steam costs a few dollars per year) perhaps if in the future if things are settled then it would not be a problem at all, but now Mark is in tight ropes and needs to carefully plan the next step.
However the point here is to look at the big picture, other than Steam you can consider that there are many other repositories that can host Monkey as means of promoting. Just to name a few…
chocolatey (windows)
brew (mac)
apt (ubuntu – mint – etc), pacman (arch linux)
ubuntu software center (ubuntu family)
Windows Store, Apple Store, Steam (there are those that cost and can be considered last)
Now perhaps if the appropriate Python scripts are written that would automatically upload the binaries to as many of these repositories with only one command then it worth a shot.
Here’s is a good one, which has a hidden meaning.
Good one!
I wanna become a patreon for at least a year for a starter…
You can donate through itch.io make sure that you mention your username to Mark as well.
Do you plan to roll your own frame limiter? Tell us the result after this.
You can turn of the GLSwapInterval to let frames run wild, and then figure out how to implement the update loop.
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152#Import "<std>"#Import "<mojo>"Using std..Using mojo..Class MyWindow Extends WindowField pos:FloatMethod New()Super.New("", 500, 500)EndMethod OnKeyEvent(event:KeyEvent) OverrideIf event.Type = EventType.KeyDownSelect event.KeyCase Key.UpSwapInterval += 1Case Key.DownSwapInterval -= 1EndEndifEndMethod OnRender(canvas:Canvas) OverrideApp.RequestRender()pos += 1.0canvas.Color = Color.Bluecanvas.DrawRect(pos-2, 0, 4, Height)If pos > Widthpos -= WidthEndcanvas.Color = Color.Blackcanvas.DrawText(Millisecs(), Width/2, (Height/2)+0, 0.5, 0.5)canvas.DrawText("FPS: " + App.FPS, Width/2, (Height/2)+15, 0.5, 0.5)canvas.DrawText("Swap Interval: " + SwapInterval, Width/2, (Height/2)+30, 0.5, 0.5)EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndAwesome!
After doing some tests and trying to figure out how to add rotations I resulted to this one.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181#Import "<std>"#Import "<mojo>"Using std..Using mojo..Global gMyWindow:MyWindowClass MyWindow Extends WindowField pan : Vec2f ' to hold the panningField zoom : Float = 1.0 ' to hold the zoomingField rot : Float = 0.0 ' to hold the rotationField viewSpeed : Float = 2.0 ' the speed of panningField canvasView: AffineMat3f ' to keep a copy of the view matrixField messages : String[] ' to render some text on the screenMethod New()Super.New("", 800, 600)Stuff.Create()pan = New Vec2f(Width / 2, Height / 2)messages = New String[3]EndMethod OnRender(canvas:Canvas) OverrideApp.RequestRender()' USER INPUT FOR VIEW' user input for controlling the view valuesIf True' rotation and zoom won't have any problem' but panning will have to be based on trigonometry calculationsIf Keyboard.KeyHit(Key.Raw | Key.R)pan = New Vec2f(Width / 2, Height / 2)zoom = 1.0rot = 0.0EndIf Keyboard.KeyDown(Key.Raw | Key.Q) Then zoom -= 0.01If Keyboard.KeyDown(Key.Raw | Key.E) Then zoom += 0.01If Keyboard.KeyDown(Key.Raw | Key.A)Local speed := viewSpeed * zoompan.X -= Cos(rot) * speedpan.Y -= Sin(rot) * speedEndIf Keyboard.KeyDown(Key.Raw | Key.D)Local speed := viewSpeed * zoompan.X += Cos(rot) * speedpan.Y += Sin(rot) * speedEndIf Keyboard.KeyDown(Key.Raw | Key.W)Local speed := viewSpeed * zoompan.X += Cos(rot - MathHelper.DegreesToRadians(90)) * speedpan.Y += Sin(rot - MathHelper.DegreesToRadians(90)) * speedEndIf Keyboard.KeyDown(Key.Raw | Key.S)Local speed := viewSpeed * zoompan.X -= Cos(rot - MathHelper.DegreesToRadians(90)) * speedpan.Y -= Sin(rot - MathHelper.DegreesToRadians(90)) * speedEndIf Keyboard.KeyDown(Key.Raw | Key.Z) Then rot -= 0.01 * zoomIf Keyboard.KeyDown(Key.Raw | Key.C) Then rot += 0.01 * zoomEnd' SCREEN TO WORLD HIT TEST' demonstrate how convert the screen coords to world coordsIf TrueIf Mouse.ButtonPressed(MouseButton.Left)Local mouseWorldCoord := -canvasView * Mouse.LocationPrint("Mouse: " + Mouse.Location)Print("Transformed: " + mouseWorldCoord)Stuff.Hit(mouseWorldCoord)EndEnd' DRAW THE WORLDIf True' I can do PushMatrix so after this' operation is done it can be restored' to the window based coordinate systemcanvas.PushMatrix()canvas.Translate(Width/2, Height/2)canvas.Rotate(rot)canvas.Scale(zoom, zoom)canvas.Translate(-pan)Stuff.Draw(canvas)' I will have to keep a copy of the current transform' in order to use it for the hit testcanvasView = canvas.Matrixcanvas.PopMatrix()End' DRAW VARIOUS GUI STUFFIf Truecanvas.Color = Color.Blackmessages[0] = "Pan: " + panmessages[1] = "Rotation: " + MathHelper.RadiansToDegrees(rot)messages[2] = "Zoom: " + zoomFor Local i := 0 Until messages.Lengthcanvas.DrawText(messages[i], 10, 10 + (i*12))NextEndEndMethod DrawLastHitOnGUI(canvas:Canvas)If Stuff.LastHit <> -1Local p := Stuff.Items[Stuff.LastHit]canvas.DrawCircle(p.X-5, p.Y-5, 10)EndEndEndClass Stuff AbstractGlobal Items:Vec2f[]Global Hits:Bool[]Global LastHit:IntFunction Create()Items = New Vec2f[100]Hits = New Bool[100]For Local i := 0 Until Items.Length' these coordinates are world based, nothing to do with monitorItems[i] = New Vec2f(i * 20, Rnd(0, 500))Hits[i] = FalseNextLastHit = -1EndFunction Hit(p:Vec2f)For Local i := 0 Until Items.LengthLocal x := Items[i].XLocal y := Items[i].Y' no problem to use rect collision since it happens in the world spaceIf Contains(x - 10, x + 10, y - 10, y + 10, p.x, p.y)Hits[i] = TrueLastHit = iPrint("Hit Index: " + i + ", Position: " + Items[i])ExitEndNextLastHit = -1EndFunction Contains:Bool(minx:Float, maxx:Float, miny:Float, maxy:Float, x:Float, y:Float)Return x >= minx And x < maxx And y >= miny And y < maxyEndFunction Draw(canvas:Canvas)For Local i := 0 Until Items.LengthIf Not Hits[i]canvas.Color = Color.WhiteElsecanvas.Color = Color.RedEndcanvas.DrawRect(Items[i].X - 10, Items[i].Y - 10, 20, 20)NextEndEndFunction Main()New AppInstancegMyWindow = New MyWindowApp.Run()EndClass MathHelper AbstractFunction DegreesToRadians:Double(degrees:Double)Return degrees * (Pi / 180.0)EndFunction RadiansToDegrees:Double(radians:Double)Return radians * (180.0 / Pi)EndEndNerobot, where are these parts regarding the code completion?
I would like to try a few things regarding the text matching, and how items are displayed.
You can see this interesting discussion here: https://forum.lazarus.freepascal.org/index.php?topic=35689.0
Perhaps one good approach is to handle timing yourself, use the SDL module directly, since the Window class is more of a user friendly abstraction, so it meant to do the common stuff.
So using the canvas is faster right? OK I will result to it then. But still I would try a few other things if I can get it done.
Good one, it can be combined it with my multi loops here, this will allow the CPU to rest a few times.
-
AuthorPosts