-
Flash Game Maker
Dynamic Scaling?
Hi Everyone,
I am trying to make a game with a realistic laser scope in it. What I am looking for is a script that cam be placed on the laser scope MC (which is part of the character MC) that will dynamically adjust it's width to fit in between the character MC and objects such as walls, enemies, etc.
How would I go about doing this?
Thanks,
Mr_Welfare
Using Flash MX 2004
-
Flash Game Maker
If this isn't possible, could someone please let me know so I can find another method?
-
Flashmatics
dont understand the question...make it a bit more clear?maybe draw a diagram explaining it?
-
Flash Game Maker
Ok sorry about being unclear. I hope this quick diagram sums things up well enough.
http://i108.photobucket.com/albums/n...er/Example.gif
Mr_Welfare
-
Flash Game Maker
Is it still unclear? Sorry if it is. I can take a little more time on the diagram if you want.
-
Flashmatics
If i understand correctly..why not just use the lineTo() method between the movieclips?
-
Flash Game Maker
I've never heard of it. Could you explain?
Thanks.
-
Flashmatics
its a movieclip method for drawing lines..heres an example i did sometime ago..
create two movieclips on stage for example square1_mc and square2_mc and use the following code..whenever u drag them a line will be between them..
Code:
_root.lineStyle(1, 0, 100);
_root.moveTo(square1_mc._x, square1_mc._y);
_root.lineTo(square2_mc._x, square2_mc._y);
_root.onMouseMove = function() {
clear();
_root.lineStyle(1, 0, 100);
_root.moveTo(square1_mc._x, square1_mc._y);
_root.lineTo(square2_mc._x, square2_mc._y);
updateAfterEvent();
};
for (var i = 1; i<3; i++) {
_root["square"+i+"_mc"].onPress = function() {
this.startDrag();
};
_root["square"+i+"_mc"].onRelease = function() {
this.stopDrag();
};
_root["square"+i+"_mc"].onReleaseOutside = function() {
this.stopDrag();
};
}
Note ive defined the event handlers in a loop so as to prevent code duplication
also do a search on google for the lineTo() method or look in flash docmentation
-
Flash Game Maker
Ok. This connects two objects together with a line. How would I go about editing this script so that the line would be "connected" to the front of the characters gun, and so it would be able to fit in between multiple mcs?
-
Flashmatics
put a tiny invisible movieclip on the tip of the gun and use that as the mc the the line connects to.. or make the tip of the gun the registration point instead.. how exactly do u want it to connect to multiple mcs? maybe draw another diagram? i'll check this post tommorow..anyway im off to sleep dude..amost 1am here lol..
-
Flash Game Maker
I'm afraid I failed to illustrate how the character rotated.
http://i103.photobucket.com/albums/m...e/Diagram2.gif
Here is a better diagram.
Note: The laser could hit an object at any angle or place.
Also, the last laser stops a little short (It was offscreen in flash, but not in the photo)
-
Flash Game Maker
Well, if this isn't possible, (based on what some other people have told me, I'm starting to think that it isn't.) Does anyone know of a way that could come in any way close to this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|