Page 1 of 1

Phun powered games and parameters in an existing body

PostPosted: Sun Dec 20, 2009 11:44 pm
by cheery
I tinkered with phun while ago and found out bunch of variables on objects of any kind. Only trouble is it was insufficient. I didn't find a way to alter existing physical parameters of a physical body (change it's motion, size or form other than liquidify it). I'd also LOVE to put some phaser saber mounted on a spacecraft cut objects apart!

In short, galaga sandbox I'm dreaming about.

Version: Phun beta 5.28 linux x64

Any proper programming language has up-to-date proper documentation. Scripting languages aren't useful if you have to guess everything. I figured out what I did through tab-completion in the thyme console.

If you'd have some more scripting features, you might end up with people writing games on it. (Well, you could write pong and perhaps a breakout in it already ^^ want to see?).

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 12:20 am
by StephenAlverez
I don't see your point. Is it to find a way to make lasers in phun, make a "galaga sandbox," whatever that is, change paramaters, or change motion? They are impossible, but you can make motion of an object start out changed (like a gun) change.

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 4:40 pm
by cheery
Well, I make it clear.. If phun were improved by adding more features to observing and affecting the simulation from within the script and some simple modules for varying bookkeeping tasks, people would be able to write large variety of computer games on phun.

Thanks from the reply, I'm probably never thinking clearly enough to construct a sentence that makes it clear for everybody what I'm trying to tell.

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 6:40 pm
by cheery
While at it, I wrote a quick paddleball -game. There's couple of fun things you might want to do. Just don't let the paddles hit liquifiers.

http://www.2shared.com/file/10138317/51 ... eball.html

It'd be nice if I could constraint the ball velocity to be constant. That'd prevent the ball stopping and I could put the friction back in.

Also, I didn't figure out how to write functions, keybindings or variables inside the scene. They always go to the config. :/

I'm not sure whether phun is good for this kind of stuff. Perhaps I should go and implement a physics constraint solver of my own and editor specific for creating game assets. Anyway, just few ideas I had here. Oh. I forgot to give you a screenshot. Whoops. I forgot it on with bunch of balls on the screen. My paddleball watered up.

http://img686.imageshack.us/img686/2601/paddleball.png

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 7:10 pm
by standardtoaster
You can write functions and variables inside a scene by adding Scene.my. in front of it. You can keep the the ball at a constant velocity if you turn it's air friction off. Go to its script menu, find the part that says AirFrictionMult, change its value to zero.

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 9:45 pm
by cheery
Removing air friction doesn't really help. The velocity drops if there's friction or insufficient elasticity in the objects. Occassionally the velocity also drops from paddle hitting the restriction planes. Nope. The ball in paddleball is more like a devilish object moving at a constant increasing velocity. I can simulate it with 1.0 <= elasticity values but with results that object eventually flies out from the level.

You had an interesting link in your signature: viewtopic.php?f=14&t=795 Do you know a simple way of figuring out the geomID of a circle without having to predefine it?

Re: Phun powered games and parameters in an existing body

PostPosted: Mon Dec 21, 2009 9:59 pm
by KarateBrot
you can do that with "new method". use the search bar at the top to find it.

Edit:
i already did it.
http://www.algodoo.com/forum/viewtopic.php?f=13&t=545