Monkey Archive Forums/Digital Discussion/Hi

QuietBloke(Posted 2011) [#1]
Just wanted to say Hi to all here.
These forums seem quite quiet at the moment... early days I guess.

I've been a big fan of the Blitz languages over the years I've bought pretty much all of them !

I dont get much time for coding at home.. and as I do it for a living I go through phases where the last thing I want to do is power up the laptop when I get home yet alone write some code... but when I saw Monkey I just had to get it.
From what I see so far Im loving it.


marksibly(Posted 2011) [#2]

Yes it is a bit quiet!

Hopefully that means everyone's busy working on their projects...

DGuy(Posted 2011) [#3]
Yup, ... working like a mad-man re-coding my iOS app (originally written in ObjC/C++) in Monkey for inclusion in the NookColor Shop ASAP!!

(I haven't even had time to play a videogame or watch a movie in close to a month!)

Oh, ... and Welcome, QuietBloke ... :)

Hima(Posted 2011) [#4]
Welcome, QuietBloke! I suppose it's because people are true busy playing with Monkey, working on theirown game, coming up with extensions and helping Mark with bug reports and stuffs.

I haven't done much game coding lately either...just finished a whole week of iOS programming training. I also shamelessly promoted Monkey to the students :P

NookColor!? Monkey can build for NookColor target too?? :D

therevills(Posted 2011) [#5]
Ive noticed that a lot of coding forums are pretty quiet at times :P

@Hima, the NookColor runs on Android ;)

QuietBloke(Posted 2011) [#6]
Before I found Monkey I was working on writing games in Html5 Canvas. I managed to get a 95% working Asteroids clone working ( Needed to finish adding UFO's). All done with just lines ( no external media ). I got stuck trying to generate sounds in-code.

Now I'm working on re-writing it in Monkey. Its all going swimmingly at the moment. Love not having to mess around trying to get javascript to do Objects / inheritance etc. This might just be the push I need to actually finish the game.

Looking forward to see what you guys come up with.

PS: Anyone know of a good example of implementing PointInPolygon ?

MikeHart(Posted 2011) [#7]
It looks quite but I think slowly it is becoming more and more busy here.

Till October I will be very busy writing a book about Game development with Monkey. So most of my Monkey related work will not be visible till the book is out.

JIM(Posted 2011) [#8]
Quiet indeed, but here you go:

Function PointInPoly:Bool(x:Float, y:Float, poly:Float[])
	local i:Int, j:int, c:Bool
	local v1:Bool, v2:Bool, v3:Bool, v4:Bool, v5#, v6#, v7#
	c = false
	local p_count% = (poly.Length() / 2)
	For i = 0 To p_count-1
		j = (i+1) Mod p_count
		v1 = (poly[i*2+1] <= y)
		v2 = (y < poly[j*2+1])
		v3 = (poly[j*2+1] <= y)
		v4 = (y < poly[i*2+1])
		v5 = ( poly[j*2]-poly[i*2] ) * ( y-poly[i*2+1] )
		v6 = (poly[j*2+1]-poly[i*2+1])
		If v6 = 0.0 Then v6 = 0.0001
		v7 = poly[i*2]
		If (   ( (v1 And v2)  Or ( v3 And v4) ) And ( x < v5 / v6 + v7)   ) Then c = not c
	Return c

Don't ask for an explanation of the code. It just works :)

QuietBloke(Posted 2011) [#9]
thanks Jim. Thats saved me some time.

Virtech(Posted 2011) [#10]
Thanks for the code Jim. Please post it in the monkey code section, so we know were to find it next time ;)

JIM(Posted 2011) [#11]
Done :)
Glad you find it useful.