Forum Replies Created
-
AuthorPosts
-
I did some updates to the original post to include directions for MSVC2017, currently I have switched to MSVC and it seems good.
Yeah, as nerobot says, by going to this directory: monkey2\scripts you can see various bat-sh files that use such commands, useful as examples.
For example a typical console application would be “rebuildmx2cc.bat”. A gui application that uses the mojox module would be “rebuildted2.bat”.
Perhaps following the latest trends the astronaut would ride a roadster, instead.
This WebAssembly thing was fun.
This time I took another approach to the design. It has stuck to me for a couple of days now, the power of abstraction. Instead of adding more details to the design the point is to actually take things out. For this reason I took out some details. Now from my point of view the logo seems more “grounded” or “serious”, perhaps the eyes previously made the monkey in the logo look too cute, but now the purpose is to become more pumped and badass.
Another reason for the abstraction is where you can consider the Python language, where the logo has the resemblance to the python animal but not presenting it literally in the full form. Actually from what I remember python meant to be a reference to Monty Python. Anyways…
There are various variations, logo, letters, transparent_logo+letters. Colors come into both variations, pinkish and blue. I am not against pinkish theme but I could consider adding the blue version for the sake of comparison.
Also I had some thoughts, about the case of trying to see the plain “mx” case, how it looks and how it rolls. The mindset for this is that if you can consider that many languages are named after for letters. Since mx has a historic sense it makes a good alternative. Another consideration is where the PHP language started as something like “Personal Homepage Preprocessor” but since it has evolved too far since it’s creation, now the PHP stands on it’s own as letters an abstraction. But anyway this is just a test.
These images are tests, done in a great hurry. I can create high resolution versions if needed, though is easy to reproduce. The font I use is Ubuntu Mono since the licence good.
Attachments:
Great demo!
One thing I noticed was by switching a tab in this forum for about 30 seconds and then activating the plane tab again, the game was spinning like crazy and the plane went into the “stratosphere”. Anyone else noticed that?
I use chrome on windows.
Downloaded and tested it, it surely looks interesting , some notes I have:
- When I tried to move towards the car (level starts and I move forward), I got stuck on the hill while going down. Perhaps it would help to allow the player move into more steep slopes. Also perhaps allowing little jumping might be good to avoid getting stuck.
- As I was moving, the camera wanted to slightly rotate on it’s own. I have no gamepad attached though, in case it was a calibration issue.
- Perhaps having an .ini configuration file might help, I would set the resolution I want that way (1920X1050), the mouse speed (I have low DPI mouse and I would set it to faster).
- Perhaps a cinematic in the beginning would help understand what is going on. That you are an astronaut, and your ship crashed, and now you have to survive. A clever idea to avoid animations is to have simple model placements according to frame time, that would look like 3D comic strips.
I hope this feedback would give you more ideas you can use
These are tremendously important components, thanks for posting.
Perhaps we could drop various ideas in case there is interest into making a full featured profiling framework, if it’s really useful and needed by the people who use Monkey. One such idea would be to attach some sort of console input and logging mechanism which can be useful when debugging the application at runtime. http://monkeycoder.co.nz/forums/topic/mojox-gui-components/ .
Since I wanted to try writing a console based application and I could not figure out the input streams I did this.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105#Import "<std>"#Import "<mojo>"#Import "<mojox>"Using std..Using mojo..Using mojox..Class Console AbstractPublicFunction Create()Instance = New ConsoleClassEndGlobal ReadLineCallback:Void(input:String)Function Write(text:String)Instance.Write(text)EndFunction WriteLine(text:String)Instance.WriteLine(text)EndPrivateGlobal Instance : ConsoleClassClass ConsoleClass Extends WindowPrivateField textInput : TextFieldField textOutput : TextViewPublicMethod ClearOutput()textOutput.Clear()EndMethod ClearInput()textInput.Clear()EndMethod Write(text:String)textOutput.AppendText(text)EndMethod WriteLine(text:String)textOutput.AppendText(text + "~n")EndMethod New()Super.New("Monkey2 Console", 640, 480, WindowFlags.Resizable)textInput = New TextFieldtextOutput = New TextViewtextInput.Entered = Lambda()If Console.ReadLineCallback <> NullConsole.ReadLineCallback(textInput.Text)textInput.Clear()EndEndLocal label := New Labellabel.Text = "Input: "label.AddView(textInput)Local dockingView := New DockingViewdockingView.AddView(label , "top", "10%")dockingView.AddView(textOutput, "bottom", "90%")ContentView = dockingViewEndEndEndFunction GetCommandResult:String(command:String)Select commandCase "help"Local output := ""output += "Available Commands~n"output += "~qhelp~q, ~qhello~q, ~qquick math~q"Return outputCase "hello"Return "Hello There"Case "quick math"Return "two plus two is four, minus one is three"EndReturn NullEndFunction SetupCommands()Console.WriteLine("Type ~qhelp~q for more information.")Console.ReadLineCallback = Lambda(input:String)Local result := GetCommandResult(input)If result = Null Then result = "Command not identified."Console.WriteLine(result)EndEndFunction Main()New AppInstanceConsole.Create()SetupCommands()App.Run()EndYeah in some sense Blitz3D was “interpreted” language since the code turned into objects that run in the C++ engine. Blitzmax on the other hand was converted to assembly (fasm) so it would be considerably more optimized code rather than other high level source (such as C++). Monkey2 on the other hand is compiled as C++ source code.
However is MSVC considerably faster than gcc? I havent tried it yet though but I am interested too in trying it.
The console can easily toast the competition in terms of practicalilty, I am impressed so far.
This looks great.
Now I am throwing away some stuff and cleaning up my drives, this code I had written a year ago (there was no Ted2Go back then
). It does not mean much but anyways… If for some reason there is something useful it would not mind to grab it. The implementation does not match Ted2Go but with a few porting it will work. There were about a dozen of features but all of them were added to mojox or Ted2Go
Line commenting is interesting since it uses toggling, similar behavior to Sublime.
Monkey1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283Class PluginTextView_LineComment Extends PluginTextViewPublicProperty Name:String() OverrideReturn "Toggle comment for lines."EndProperty Shortcut:String() OverrideReturn "Alt + C"EndProtectedMethod New()AddPlugin(Self)EndMethod OnFilterKeyEvent(event:KeyEvent, textView:TextView) OverrideIf IsModifierPressed(event.Modifiers, Modifier.Alt)If IsEventKeyDown(event) And event.Key = Key.C' the status of the first line will define the operation that is going to be used.' when it is to add comment, it will always be done (characters will be appended).' when it is to remove comment, it will be done when: a) comment character is found, b) is in the same identation levelLocal operation := "None"Local indexComment := 0Local indexCommentStart := 0Local lineStart := textView.Document.FindLine(Min(textView.Cursor, textView.Anchor))Local lineEnd := textView.Document.FindLine(Max(textView.Cursor, textView.Anchor))For Local i := lineStart To lineEndindexComment = SearchCommentCharacterIndex(textView.Document.GetLine(i))If operation = "None"If indexComment = -1 operation = "Add" Else operation = "Remove"indexCommentStart = indexCommentEndIf operation = "Add"AddComment(textView, i)Elseif operation = "Remove" And (indexComment <> -1) And (indexCommentStart = indexComment)RemoveComment(textView, i, indexComment)EndNextevent.Eat()EndEndEndPrivateMethod SearchCommentCharacterIndex:Int(line:String)For Local i := 0 Until line.LengthLocal s := String.FromChar(line[i])If s = "'" Return iIf TextViewFeat.IsCharacterAlphaNumeric(s) Return -1NextReturn -1EndMethod AddComment(textView:TextView, line:Int)Local cursorCurrent := textView.CursorLocal cursorStartLine := TextViewFeat.LineStartIndex(line)textView.SelectText(cursorStartLine, cursorStartLine)textView.ReplaceText("'") ' characters shift one position to the righttextView.SelectText(cursorCurrent + 1, cursorCurrent + 1)EndMethod RemoveComment(textView:TextView, line:Int, index:Int)Local cursorCurrent := textView.CursorLocal cursorStartLine := TextViewFeat.LineStartIndex(line)Local characterIndex := cursorStartLine + indextextView.SelectText(characterIndex, characterIndex + 1)textView.ReplaceText("") ' characters shift one position to the lefttextView.SelectText(cursorCurrent - 1, cursorCurrent - 1)EndGlobal _instance := New PluginTextView_LineCommentEndMove lines up and down is a shortcut for cut and paste.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130Class PluginTextView_MoveLine Extends PluginTextViewPublicProperty Name:String() OverrideReturn "Move a line or a selection of lines."EndProperty Shortcut:String() OverrideReturn "Alt + Up/Down Arrow"EndProtectedMethod New()AddPlugin(Self)EndMethod OnFilterKeyEvent(event:KeyEvent, textView:TextView) OverrideIf IsModifierPressed(event.Modifiers, Modifier.Alt)If event.Type = EventType.KeyDownIf event.Key = Key.UpMoveLineVertical(textView, -1)event.Eat()ReturnEndIf event.Key = Key.DownMoveLineVertical(textView, 1)event.Eat()ReturnEndIf event.Key = Key.EnterPrint("Cursor: " + textView.Cursor)event.Eat()ReturnEndEndEndEndPrivateMethod Column:Int(index:Int)Return index - TextViewFeat.TextViewInstance.Document.StartOfLine(TextViewFeat.TextViewInstance.Document.FindLine(index))EndMethod MoveLineVertical(textView:TextView, delta:Int)Local textViewAnchor := Min(textView.Anchor, textView.Cursor)Local textViewCursor := Max(textView.Anchor, textView.Cursor)' get linesLocal blockLineStart := textView.Document.FindLine(textViewAnchor)Local blockLineEnd := textView.Document.FindLine(textViewCursor)' store cursor and anchor column indexLocal storeAnchorColumn := Self.Column(textViewAnchor)Local storeCursorColumn := Self.Column(textViewCursor)' recalculate line rangeIf delta = 0 Then ReturnIf delta < 0 Then blockLineStart -= 1If delta > 0 Then blockLineEnd += 1' validate line rangeIf blockLineStart < 0 Then ReturnIf blockLineStart >= textView.Document.NumLines Then Return' get the text rangeLocal blockLines := New StringListFor Local line := blockLineStart To blockLineEndblockLines.Add(textView.Document.GetLine(line))Next' perform the line swappingIf delta < 0 ' when moving up first cell becomes the lastLocal a := blockLines.RemoveFirst()blockLines.AddLast(a)Else ' when moving down last cell becomes the firstLocal z := blockLines.RemoveLast()blockLines.AddFirst(z)End' replace the textLocal blockText := blockLines.Join("~n")textView.SelectText(TextViewFeat.LineStartIndex(blockLineStart), TextViewFeat.LineEndIndex(blockLineEnd))textView.ReplaceText(blockText)' restore cursor positionLocal getPosition := Lambda:Int(textView:TextView, line:Int, column:Int)Return textView.Document.StartOfLine(line) + columnEndIf textViewAnchor = textViewCursor' no text is selectedLocal newCursor := 0If delta < 0newCursor = getPosition(textView, blockLineStart, storeCursorColumn)ElsenewCursor = getPosition(textView, blockLineStart + 1, storeCursorColumn)EndtextView.SelectText(newCursor, newCursor)Else' text is selectedLocal newAnchor := 0Local newCursor := 0If delta < 0newAnchor = getPosition(textView, blockLineStart, storeAnchorColumn)newCursor = getPosition(textView, blockLineEnd - 1, storeCursorColumn)ElsenewAnchor = getPosition(textView, blockLineStart + 1, storeAnchorColumn)newCursor = getPosition(textView, blockLineEnd, storeCursorColumn)EndtextView.SelectText(newAnchor, newCursor)EndEndMethod MoveLineHorizontal(textView:TextView, direction:Int)EndGlobal _instance := New PluginTextView_MoveLineEndCurrying and other higher order functions…
It looks awesome, lots of inspiration for code hits me with this weather.
-
AuthorPosts

