Forum Replies Created
-
AuthorPosts
-
My preference would be to use “And” / “Or” as the line continuation instead of .. if possible
Yeah, but I needed an ElseIf for all the conditions
[/crayon]Monkey123456[crayon-5cba9e1dbd4b6194575362 inline="true" ]If _level.GetCollisionTile(tempX - w2 , position.y + h2 - 1 ) = 0 And _level.GetCollisionTile(tempX - w2 , position.y - h2) = 0 And _level.GetCollisionTile(tempX - w2 , position.y) = 0position.x = tempXElseposition.x = Round((position.x - w2) / _level.TileSize) * _level.TileSize + w2EndIn one place I did split it up like so:
[/crayon]Monkey12345678910111213141516171819202122[crayon-5cba9e1dbd4bb640539889 inline="true" ]Local tileData:Int[] = New Int[3]tileData[0] = _level.GetCollisionTile(position.x - w2 + amount, tempY + h2 - amountY)tileData[1] = _level.GetCollisionTile(position.x + w2 - amount, tempY + h2 - amountY)tileData[2] = _level.GetCollisionTile(position.x, tempY + h2 - amountY)If tileData[0] > 0 Or tileData[1] > 0 Or tileData[2] > 0deltaValue.y = 0_jumping = falseposition.y = Round((tempY + h2) / _level.TileSize) * _level.TileSize - h2SetupStandAnimation()If tileData[0] = 92 Or tileData[0] = 93 Or tileData[1] = 92 Or tileData[1] = 93 Or tileData[2] = 92 Or tileData[2] = 93SetupDieAnimation()deltaValue.y = -430EndElseposition.y = tempYEndAdded a simple platformer example:
https://github.com/therevills/diddy2/blob/master/examples/diddy2platformer.monkey2

Good! Thought I was missing something and I was trying everything to get it to work
In MonkeyX1 I had:
[/crayon]Monkey12345[crayon-5cba9e1dc45f7409590240 inline="true" ]if game.level.getCollisionTile(x - image.w2 + amount, tempY + image.h2 - amountY) > 0 orgame.level.getCollisionTile(x + image.w2 - amount, tempY + image.h2 -amountY) > 0 orgame.level.getCollisionTile(x, tempY + image.h2 - amountY) > 0 thenBut in Monkey2 its currently:
If _level.GetCollisionTile(tempX - w2 , position.y + h2 - 1 ) = 0 And _level.GetCollisionTile(tempX - w2 , position.y - h2) = 0 And _level.GetCollisionTile(tempX - w2 , position.y) = 0(hmmm that is meant to be one long line…)
So its a bit long to read nicely…
Is there a format to split an “IF” statement over multiple lines?
How are you going with this?
Using the Map class, I could not read the correct Bool type, which always returns False
What was the issue?
Maybe, but I’m a Java developer so like to use encapsulation when I can
But for Struts, I’ve decided on having them public.
A player can be a sprite or a player can have a sprite…
Anyway I had a head scratching issue last night with Vec2s: Position.X += Speed.X didnt work. Position is an auto property which returns a Strut! So pass by value! D’oh! I’d forgot that Vec2s are Struts!
Changed all the private Vec2s fields in Diddy2 to public fields and removed the auto properties!
Out now on Steam! Includes Steam Achievements!
http://store.steampowered.com/app/725170/Home_Run_Solitaire/
October 17, 2017 at 8:24 am in reply to: Is Mark pulling the plug on Monkey2? Worrying comments on Twitter #11142If you havent seen, Mark has replied here:
http://monkeycoder.co.nz/forums/topic/worried/#post-11132
@amon – let me know what you think!
Added AnimationBank which is automatically added to Sprite:
[/crayon]Monkey12345678910111213141516171819202122232425262728293031[crayon-5cba9e1dd53e7919882242 inline="true" ]Class Player Extends SpriteMethod New(img:Image, position:Vec2f)Super.New(img, position)' create animation called "run_right" with 8 framesCreateAnimation("run_right", 8)' Add images from the AssetBank to the "run_right" animationFor Local i:Int = 1 To 8AddFrame("run_right", "gripe.run_right" + i, i - 1)Next' create animation called "gripe.die" with 4 framesCreateAnimation("gripe.die", 4)' Add images from the AssetBank to the "gripe.die" animationFor Local i:Int = 1 To 4AddFrame("gripe.die", "gripe.die" + i, i - 1)Next' Set the current animation to be "run_right" running at 50ms per frame and loopingSetCurrentAnimation("run_right", 50, True)EndMethod Update()' Update the animationUpdateAnimation()EndEndI concur with Adam, that is great to hear Mark!
I’ve really been digging Monkey2 for a couple of weeks now, the language is great and it just works!
I know I havent added anything to Patreon, but have bought both modules on itch (which should be advertised here too!) so I hope that has helped a tiny bit.
Hope Monkey2 has a long and happy future!
Well I’ve been pretty busy with Diddy2 over the past week:
https://github.com/therevills/diddy2/commits/master
* Added TexturePacker support
* Added ChanelManager
* Added SoundAsset
* Fixed a bunch of issuesJust committed a WIP animation system in the example:
https://github.com/therevills/diddy2/blob/master/examples/diddy2test.monkey2Most of that will be moved to the Sprite class very soon!
Most of those logos are for the company, not for a language.
You need examples of products, such as Oracle DB:

Or Game Maker 2:

Or HTML5:

Or UE4:

Construct 2:

Until an official one has been decided on I’m using this one:

and

So I’ve restarted coding for Diddy2…
It’s early days and I’m going to use it for the Syntax Bomb Halloween Challenge, so building code when I need it.
Attachments:
-
AuthorPosts

