-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|761|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
cyangames
Created : 01 April 2014
 
System : Mac

Beginning Monkey-X

Day 2

So, I decided to take a break from my usual Unity3D Stuff and have a bash at learning some Monkey-X instead.

Unity is great but I feel like trying my hand at something a litttle more involved. Why? Because it's fun to learn new stuff and getting to grips with proper classes should be a nice expereience. Also, writing some sort of framework is going to be a challenge for certain!

I may not be able to post too frequently as my time is divided between my day job as a web monkey, family and then coding games but I'll post when and where I can.

Anyhoo, Day 2 aand Day 1

With the thanks to the docmentation on the monkey site and a look through a couple of tutorials I've managed to cobble together a couple of classes with some basic functioonality. I've got the beginnings of a nice little Particle Class supporting layers, optional scaling, gravity and fading which seems like a decent start.

I've had a bit of fun with Matrix scaling to ensure any future android releases should scale nicely which I'll probably look at again after purchasing the full version and Monkeyed around with simple functions, quitting applications, playing a quick sound effect and opening browsers to certain urls.

Monkey seems to be pretty powerful, I tested out displaying over 1,000 particles onscreen, with alpha and referencing a couple of global images loaded in on init and nothing seemed to slow up. I have a feeling that the only thing slowing it up could be meprinting to the console at the moment!

Gonna write up a basic button class, depending on how the lil baby sat on my lap acts and see if I can get that interacting with the mouse. Then, maybe check out some sorta rectangle to rectangle collision maybe.


 

Comments


Tuesday, 01 April 2014, 16:21
Jayenkai
Hello!! Welcome aboard!!!

General avoidance things.
HTML5 target, avoid using SetColor too much as it tends to slow down. HTML is alarmingly poor at doing that!
Android target, avoid using Additive Blend, as some devices similarly slow to a crawl, for some odd reason. Also, "not CLSing" doesn't work on all Android devices.
Tuesday, 01 April 2014, 16:32
cyangames
Heyyy, thanks Jayenkai!

Will do, I've not played with SetColor yet. I'm guessing it's just as it would be in Flash though, still, thanks for the performance tips

Additive Blend could be nice for particles but for the moment I think I'm going to stick with just sprites with frame based animations, then see how things perform from there.

Is it considered okay to use globals for images, etc and effectively pass it in by reference? I'm figuring have a general load screen at the start for all (probably) assets then?

I love CLSing, takes me back to the days of Commodore,BBC and qBasic

Will try and post some sorta demos as I get things together, expect a bit of mish-mash for a while though
Tuesday, 01 April 2014, 16:41
Jayenkai
Global-wise, Whatever works for you... Most Dev's nowadays try to avoid Globals, but I use the things all over the place. I much prefer to load an image/sound/giant array, then access it everywhere. Seems more natural to do it that way.
Monkey will happily let you do that, and ... Well, I've not broken it, so far, so that's alright!!
Tuesday, 01 April 2014, 17:12
cyangames
\o/ Thanks Dude, will keep things posted on here
Wednesday, 02 April 2014, 15:56
Kuron
I look forward to seeing your progress with Monkey-X.
Wednesday, 02 April 2014, 16:10
cyangames
Hey, thanks Kuron, I've just made another quick post now before I head back to the editor
Thursday, 03 April 2014, 08:04
9572AD
I've asked about this on the Monkey forums.

Since your entire program in Monkey is itself a class, the preferred method is to define Fields for that class. Anything that is a Field of your app class winds up being a globally accessible variable without being a 'global variable'.

I thought it was a silly distinction, myself.
Thursday, 03 April 2014, 11:10
cyangames
Thanks 9572AD.

Will see if it causes grievances on older droids in the future, it's not like I will be showing off the code to others, unless something odd happens