Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Physics world

Author
Message
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 12th Sep 2011 22:20
Hi all! I am messing around with physics sprites, but I'm abit stuck on how to make rigid object that physics sprites will hit and interact with, say a 45 degree slope that will not move, but a physics enabled egg will tumble down it... any ideas?

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 12th Sep 2011 22:22 Edited at: 12th Sep 2011 22:26
I believe you're looking for the 'Rigid' (Or Static, in this case) state in the following command. SetSpritePhysicsOn(SpriteID, PhysicsMode)

EDIT: Fixed the URL.. I forgot the closing tag.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Sep 2011 22:23 Edited at: 12th Sep 2011 22:27
You can make a "static" type physics object. If you make a box shape object, you can rotate it 45 degrees and it will act as a slope. Or you can make a polygon shaped like a slope.


Lol, Silvester, beat me by a minute!

Yah, like he said. All physics objects are sprites, they can be static, dynamic, or kinematic.

see here for the difference

Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 12th Sep 2011 22:42 Edited at: 12th Sep 2011 22:43
oh, thanks! YES! Now it works I need to pay deeper attention to the docs... I am reading help files, and at every 4th command, I just have to go on and test it, then back to the help files, ahhh the pain of learning a new language... I am making a physics based game about a chicken flying around dropping eggs... haha don't ask...

I found out that applying rotation to sprites with physics enabled, create the most bizarre effects, and the walls were jumping around and climbing eachothers like they were under a magic spell, now I got em nailed down haha.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 12th Sep 2011 23:08
A pic of the prototype test... I'm using a few eggs in the real game LOL



Hmm... How about a level editor... I think I need to make a level editor for this game.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 13th Sep 2011 00:03 Edited at: 13th Sep 2011 00:04
One thing to watch out for when you set up your sprites for physics...

The set rotation command causes a recalculation of the sprite mass, so if you use the set mass command, use it after the set rotation on/off command.

PS - LOL, that's a LOT of eggs!

Zubby1970
AGK Backer
16
Years of Service
User Offline
Joined: 22nd May 2008
Playing: AGK Studio Always
Posted: 13th Sep 2011 00:43
im makeing a level editor built in to my game for a motor bike game. ill be posting a new video soon.

http://forum.thegamecreators.com/?m=forum_view&t=189005&b=41

There can only be one

Login to post a reply

Server time is: 2024-11-21 20:23:59
Your offset time is: 2024-11-21 20:23:59