Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Community Calendar Today's Posts Search
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > General Discussion

 
 
Thread Tools Display Modes

 
Action Script
Reply
Posted 2012-04-24, 07:37 PM
I'm making a basic physics engine for Action Script 3 for my final project in a class, anyone have experience with AS3 in case I get stuck a bit?
<script type="text/javascript">alert("remember when scripting attacks worked?");</script>
Old
Profile PM WWW Search
Asamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darkness
 
 
Asamin
 



 
Reply
Posted 2012-04-26, 01:14 AM in reply to Asamin's post "Action Script"
I wrote a few games in AS2 around 8 years ago. I probably don't remember that much of it, but perhaps I'll somehow be able to assist, anyway.

What physical laws are you going to model?
"Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
Old
Profile PM WWW Search
Chruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed it
 
 
Chruser
 



 
Reply
Posted 2012-04-26, 07:39 AM in reply to Chruser's post starting "I wrote a few games in AS2 around 8..."
Well so far I have gravity working. It also will collide with walls and react accordingly (bounces off at the correct angle and velocity decreases according to friction). I'm going to introduce multiple balls next and then figure out how to make them collide and react with each other.
<script type="text/javascript">alert("remember when scripting attacks worked?");</script>
Old
Profile PM WWW Search
Asamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darkness
 
 
Asamin
 



 
Reply
Posted 2012-04-28, 05:08 AM in reply to Asamin's post starting "Well so far I have gravity working. It..."
Circle-circle collisions are easy to detect; just check if the distance between the centers of two circles is less than the sum of their radiuses. Actually, while not computationally optimal, you can do a regular bounding box hit test (Object1.hitTestObject(Object2)) between two arbitrary objects. If the bounding box hit test detects a collision, do a pixel hit test on the two objects to determine if they really collided.

(There are various ways to optimize the latter, like transforming the bounding boxes to different shapes, or spacing vertices along the edges of objects.)

Furthermore, classical momentum is probably a good enough starting point to model the consequences of collisions. For instance, elastic collisions applied separately to the x and y components of velocity (for each object involved in the collision) looks pretty impressive.

Edit: Drag is simple enough to implement for spheres moving through a fluid (such as air), too.
"Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram

Last edited by Chruser; 2012-04-28 at 05:34 AM.
Old
Profile PM WWW Search
Chruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed itChruser shouldn't have fed it
 
 
Chruser
 



 
Reply
Posted 2012-04-28, 08:51 AM in reply to Chruser's post starting "Circle-circle collisions are easy to..."
If you gave me some way, I could upload what I have as of now. It's doing pretty good. I have drag, friction, and correct bouncing. One thing I've been thinking about, which I would figure is hard, would be having a shape with corners bounce correctly, I have no idea how to start with that. I assume I'd start with a square but I have no idea how to do that.
<script type="text/javascript">alert("remember when scripting attacks worked?");</script>
Old
Profile PM WWW Search
Asamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darkness
 
 
Asamin
 



 
Reply
Posted 2012-04-28, 02:07 PM in reply to Asamin's post starting "If you gave me some way, I could upload..."
I'd assume you need to do torque calculations.
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2012-04-28, 07:00 PM in reply to WetWired's post starting "I'd assume you need to do torque..."
http://en.wikipedia.org/wiki/Moment_of_inertia
Old
Profile PM WWW Search
!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics!King_Amazon! simplifies with no grasp of the basics
 
 
!King_Amazon!
 



 
Reply
Posted 2012-04-28, 07:04 PM in reply to WetWired's post starting "I'd assume you need to do torque..."
WetWired said: [Goto]
I'd assume you need to do torque calculations.
I've honestly never learned any equations for torque. I'm gonna show my professor my project on Tuesday and see what he thinks. He thought it would take me the full two weeks to get half as far as I've gotten so I'm doing pretty good.
<script type="text/javascript">alert("remember when scripting attacks worked?");</script>
Old
Profile PM WWW Search
Asamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darkness
 
 
Asamin
 



 
Reply
Posted 2012-04-29, 02:05 PM in reply to Asamin's post starting "I've honestly never learned any..."
So then you've never taken physics?
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2012-04-29, 02:28 PM in reply to WetWired's post starting "So then you've never taken physics?"
I took it in high school but we didn't cover torque. At least not that I remember. It was a while ago. I'm still a first year collage student, I'm taking physics next year.
<script type="text/javascript">alert("remember when scripting attacks worked?");</script>
Old
Profile PM WWW Search
Asamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darknessAsamin has an imagination enthroned in its own recess, incomprehensible as from darkness
 
 
Asamin
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Release Dates JohnnyTAE General Gaming 14 2002-10-22 09:56 PM
Release Dates JohnnyTAE General Gaming 7 2002-10-16 05:41 PM
Release Dates JohnnyTAE General Gaming 1 2002-10-15 08:01 PM
Game Release Date JohnnyTAE General Gaming 8 2002-07-09 11:21 PM
Game Release Date JohnnyTAE General Gaming 5 2002-07-04 08:04 PM


All times are GMT -6. The time now is 05:23 PM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.