Wonkey Update

Started by iWasAdam, May 23, 2021, 12:26:29

Previous topic - Next topic

iWasAdam

The reason that there is no link is a lot of what you are seeing here is not currently available - it's still in dev and also up for change, suggestions, etc :)

Aurel [banned]

wow..looking nice ..i like it  ;)
(Y)

zelda64bit

Quote from: iWasAdam on May 31, 2021, 13:00:14
Wide2 - the new wonkey editor is being put through it's paces. To do a proper test I thought I would write a tutorial.

This first one creates a well known game.  :o

It's currently got all the basic stuff like map, movement and even base enemy movement. it's created over 10 different steps each with source and is only 400 lines long!

Before anyone jumps in a starts questioning 400 lines - there are 3 other sources provided which are supplying all the draw code, map code, palette code, and render code - but these are being presented as code so you can rip them to shreds and find out how they actually work - or not as they are not 'fixed' modules.

Of course you can completely just 'use' the code without any knowledge or care about how they work too.

These are from my own libraries, so I am starting to give away my own secret sauce here...



If you are going to write tutorials, you could write them on this wonkey page, so I can translate it and learn, otherwise it will be difficult for me.

https://wonkey-coders.github.io/

About examples, they should be simple and small examples, like Pakz's examples, I love this person's examples and they are very easy to follow, especially those that put beginners.

Hotshot

Will Wonkey have Game library such as SDL or SFML or Allergo add on?

iWasAdam

wonjey has all of monkey2 module and they have been updated to the latest versions.

so sdl2 is there, Raylib is coming along with sokol,

Wonkey itself is a just language. but if we can get it into a state that people feel really happy about using. then they will be able to do what they want with it.

RE the tutorial. Yes it could go on the website
But. it's a very different style and approach. the tutorial is made from lots of sample files. the first tutorial just opens the window and sets up the custom canvas.
Here it is. Is there anything that would help make it clearer?

Namespace myapp


#Import "<std>"
#Import "<mojo>"
Using std..
Using mojo..

'1st Step is To pick a template - this is the custom canvas template

'the arcade resolution is 224 x 288
'this will be our custom canvas resolution
Const Resolution:Vec2i = New Vec2i( 224, 288 )

Function Main()
New AppInstance
New MyWindow
App.Run()
End


Class MyWindow Extends Window

'this will be your custom canvas
field myCanvas:Canvas
'a canvas needs an image to draw to
Field canvasImage:Image


Method New()
'If you are Using highdpi displays then use this vesion
'Super.New( "My Window", 640, 480, WindowFlags.Resizable | WindowFlags.HighDPI )
Super.New( "My Window", Resolution.X*3, Resolution.Y*3, WindowFlags.Resizable )

'first create an image of the requires size
canvasImage = New Image( Resolution.X, Resolution.Y )
'And use this To crate a canvas
myCanvas = New Canvas( canvasImage )
End


Method OnRender( canvas:Canvas ) Override
App.RequestRender()

'fill the custom canvas with a color
myCanvas.Clear( Color.Black )

'draw some text to the custom canvas
myCanvas.Color = Color.White
myCanvas.DrawText( "Width:"+Width+" Height:"+Height, 5,5 )
myCanvas.DrawText( "ResX:"+Resolution.X+" ResY:"+Resolution.Y, 5,25 )

myCanvas.DrawText( "Resize the window", 5,50 )

'finish drawing To our canvas
myCanvas.Flush()

'finally draw the custom canvas to the normal canvas
canvas.Color = Color.White
canvas.DrawRect( 0, 0, Width, Height,  canvasImage )
End

End




zelda64bit

What are these two libraries for?
#Import "<std>"
#Import "<mojo>"

And this App.Run ()
And this other myCanvas = New Canvas (canvasImage)

And this canvas: Canvas
And this App.RequestRender ()

And this Super.New ("My Window", Resolution.X * 3, Resolution.Y * 3, WindowFlags.Resizable)

and this myCanvas.Flush ().

I know there are comments, but what is inside the code window is not translated.

iWasAdam

No problem  ;D I'll sort out those brilliant suggestions for you.

It should be said that wonkey shares a lot of the underlying c++ structures. So it can be a bit of a struggle at first coming from an older simple basic dialect.

So you will have to get used to stuff like classes, methods, import, etc. But none of this is too difficult. My personal aim would be to make it more approachable - so some more in depth comments in the templates would help a lot :)

Aurel [banned]

QuoteIt should be said that wonkey shares a lot of the underlying c++ structures

well to me ...looks like wonkey is a one big wrapper of C++ functions
(Y)

round157

#38
For micro(A) and Wonkey, I think that....:

1. Each language should have an detailed information page on Itch.io. A lot of visitors are there. The information pages on Itch will become very effective introduction of these two languages to many potential users. As a result, the user bases of these two languages will be enlarged easily.

2. Ask Qube to set up the sub-forums for micro(A) and Wonkey respectively in this forum. So various information of these two languages will be under different titles(or threads) in these two sub-forums. Thus people can easily find topics which they are interested in reading by reading titles.   

iWasAdam

Quotewell to me ...looks like wonkey is a one big wrapper of C++ functions
in some respect aren't all modern languages derived from c or share commonality with oop?

Wonkey is a language that has it's heritage in blitz products and has evolved to have much more of oop. It is cross platform and transpiles to c and then to host executable.

It has 3 main parts:
1. WAKE - eats wonkey files transpiles them into c and links and produces the final product. current targets are winows, macos, linux, arm, raspberry pi - there are others
2. WIDE - the wonkey ide with wide2 in current dev
3. modules - these are all the libraries and other bits an app might need. there are core modules like std and mojo which provide all the base functions, etc


Aurel [banned]

Quotein some respect aren't all modern languages derived from c or share commonality with oop?

Yes ..that is true.
(Y)

Aurel [banned]

To answer round...
There is no need to open any new board for micro(A) simply because it is to early for
and let say solid programming in it .
Also there is no any connections between two of them , mine is more experimental or if
you wish eductional to me in  first place .

For wonkey ..well it is game oriented language .
(Y)

iWasAdam

QuoteFor wonkey ..well it is game oriented language.
Unfortunately I'm definitely going to call you out on that one. Wonkey is primarily a language. I and others have provided a lot of modules and code to allow for games to be more easily created - BUT it is NOT just for games.

The best example is the WIDE editor - it's written in Wonkey:

Not a game:

Also not a game:


Currently we are looking into the QasarBeach audio core (written in monkey2 which is 100% wonkey compatible). this is not remotely a game:

The above was captured live with no overdubs (it was edited with the video being added later) But the audio and live screens showing live audio are all wonkey...

I could go on about the image editors, 3d editors, map editors, synth engines, etc that are NOT games too  :P

therevills

Nice to see Monkey2 is reborn to Wonkey! It is such a nice language to program in!  :)

Aurel [banned]

Quoteimage editors, 3d editors, map editors, synth engines

well all that is for games , i really doubt that anyone will use wonkey to build another Paintnet or Gimp or Audacity
then will use it for game

BUT ..if say that is not ..then i agree. :)
(Y)