PDA

View Full Version : Actionscript Physics project needs problems ironed out!


silv1983
03-24-2006, 09:19 PM
Hi all,

Im pretty new to this actionscript lark- I usually dabble in Flash but only recently I took a shine to the idea of scripted animation - more specifically simulating physics. Anyway, last month I picked up Keith Peters book and have been working through and playing with code from that. The physics/maths side of things are fine, I understand it all. However, whilst each chapter is pretty good in itself - im a novice programmer and so am struggling to cement the lot together (code that is). Anyway, the attached file is a sort of "playground" - and not everything is working as i'd hoped (theres only so much 'trial and error' i can handle!). If anyone has the time to have a quick look at the code and tell my why the following arent working i'd be very grateful (I use Flash MX 2004 by the way).

here goes:

- movieclip instances of "ramp" arent interacting with the balls (they did earlier on before I made more than 1 instance of the ball mc). There is a 'checkRamp' function but I cant seem to call it.

- I have no idea how to drag one instance and leave the motion code running (everything stops when I drag an mc - and recently only 1 instance of 'ball' is draggable - the rest are unclickable). This includes the pendulum in the top right corner. I have no grasp of where to slot the dragging/throwing code.

-The pendulum "ball" is an entirely different mc to the normal balls. perhaps it can be an instance of the normal ball? Im not sure.

- Ignore the ugly shape in the middle- i havent explored collision detection with irregular shapes yet.

- Finally, the sliders and update button are just for show at the moment - and if anyone knows of a good tutorial I can use to learn how to implement them i'd be grateful further still.


I think thats it - thanks in advance to any1 who can shed light. I'll check back in the morning.

Silv.