About Monkey 2 › Forums › Monkey 2 Projects › Chipmunk + TimelineFX
This topic contains 19 replies, has 6 voices, and was last updated by 
 peterigz
 11 months ago.
- 
		AuthorPosts
 - 
		
			
				
January 27, 2017 at 5:26 pm #6837
I had some old code from Blitzmax which used my own collision code, but thought I’d try doing it with Chipmunk instead. I really like Chipmunk and think it’d probably suit most of your collision needs. This demo uses chipmunk queries for culling off-screen objects, raycasting and any other general collisions and physics. I’d like to rewrite this as it’s all a bit of a mishmash after ripping out my own collision stuff, anyone interested in a full start to finish tutorial?
January 27, 2017 at 7:19 pm #6839That would be great!
I planed to make some basic learning examples for chipmunk. The only thing I’ve not tested is the different joint types. Seeing how you’ve coded this adding timelineFX is quite interesting!January 27, 2017 at 8:35 pm #6840That would be awesome! I would greatly appreciate it as I’m sure would many others!
January 28, 2017 at 1:08 am #6848+1.
February 8, 2017 at 10:26 pm #7032I’ve started a github repository for my monkey2 tutorials. I’m breaking everything down into parts and at the moment it is just heavily commented code (keeping it as simple as possible) which should still be useful. It should end up being quite a few parts and I might create a video tutorial for each part including the making of each effect used in TimelineFX.
@Mark I’m still using a “Me” field to self reference the object so that it can be passed into the ChipMunk queries but I’m not sure how bad practice that is (it seems to work fine so far). You mentioned about updating the chipmunk module to change how this works with regards to passing monkey objects, any news on that (I know you’re busy!)? Or am I safe to keep using the Me method?
Github: https://github.com/peterigz/Monkey2Tutorials
February 8, 2017 at 11:10 pm #7034That’s fantastic, would love to see more!
I’m still using a “Me” field to self reference the object so that it can be passed into the ChipMunk queries
Should be fine as long as you remember to keep ‘me’ GC-alive somehow. Generally speaking, keeping ‘me’ in a stack or list or some container will do the job.
I’m gonna be dealing with exactly the same issues soon when I tackle bullet physics for 3d and should be able to come up with a cleaner solution (although this isn’t all that bad!).
March 17, 2017 at 12:08 am #7523This is now up to part 7, slowly getting there! Had lots of work come all at once but getting a bit more time again.
Things are a bit more interesting in part 7 as you can now draw and erase tiles which are all added to the chipmunk space which automatically handles all the collisions. Next part will add scrolling around the map and parallax.
March 17, 2017 at 11:44 am #7526That’s Nice and Clean! Great step by step tutorial. Congrats! Looking forward to see things exploding.
April 2, 2017 at 8:03 pm #7680Up to part 14 which is pretty much where I was at before I rewrote it all. You can have a look online with emscripten: https://www.rigzsoft.co.uk/files/spacecraft/SpaceCraft.html
Controls: WASD to move about. Space paints rocks, backspace removes. Left mouse laser, right mouse tractor beam.
I you wanted to compile part 14 you’ll need the latest version of TimelineFX, which is currently in review in the modules section, otherwise you can grab from GitHub here: https://github.com/peterigz/timelinefx.monkey2
I want to do a YouTube walk-through from start to finish, and I’ll probably do it in much fewer parts (maybe even 1), it was just easier to do it broken up like that. Will probably tweak a bit more though, might add some lighting effects. Feel free to do your own thing with it!
April 3, 2017 at 1:57 am #7683Module has been updated and is now available via module manager!
October 26, 2017 at 1:19 pm #11329Is there way to disable simulation for custom body?
I tried to use body.sleep function but got runtime error.
Will try to temporarily remove body from world.
EDIT: I found solution.
Monkey123456cpBodySetType(cpBody, cpBodyType)Const CP_BODY_TYPE_DYNAMIC:cpBodyTypeConst CP_BODY_TYPE_KINEMATIC:cpBodyTypeConst CP_BODY_TYPE_STATIC:cpBodyType'body.Type=CP_BODY_TYPE_KINEMATIC ' ** BUT crashes app if there is no shapes attached yet! **May 9, 2018 at 11:47 am #14604I was going to try TimelineFX out, but it seems to generate some errors with current mx2. Any plans for an update?
May 9, 2018 at 12:53 pm #14605It was running ok and I *think* I have the latest version of mx2 but will check later tonight and fix if there’s any issues.
May 9, 2018 at 1:01 pm #14606Great! thanks for a speedy reply. I get an “invalid blend mode ” on Gameobject sample and then some other errors on Component sample, when I quick fix the blendmode thing.
May 9, 2018 at 6:09 pm #14607I fixed the Blendmode issue and uploaded a new version for Mark to verify, or you can grab from github: https://github.com/peterigz/timelinefx.monkey2
I think those samples are just tests and not much to do with using the actual particle effects so everything else should be ok.
 - 
		AuthorPosts
 
You must be logged in to reply to this topic.