;

PDA

Click to See Complete Forum and Search --> : best way to approach or samples?


mmreed
01-27-2002, 11:41 PM
I need to create a KM movie that shows gears meshing and turning in conjunction.

Does anyone have any samples of this, or can suggest the best way to approach it? The ones I come up with just havent been turning out right.

Bob C.
01-28-2002, 04:14 PM
Originally posted by mmreed
I need to create a KM movie that shows gears meshing and turning in conjunction.

Does anyone have any samples of this, or can suggest the best way to approach it? The ones I come up with just havent been turning out right.



I have done this (gears) in other programs before but not KM.

Here is my attempt:

http://users.rcn.com/bamc-me/GearKM.swf

The gear teeth gear diameter etc. all had to be made by eye. I couldn't draw circle centers and make them snap to grid. I'm a real novice here, but this was much fun!

Bob C.

mmreed
01-28-2002, 04:19 PM
Bob C:

Hey... I like it! Thats pretty good work!

Bob C.
01-28-2002, 05:30 PM
Originally posted by mmreed
Bob C:

Hey... I like it! Thats pretty good work!



Thanks for the kinds words mmreed. I'd be happy to e-mail the .fun file if you think that would be helpful?

Bob C.

gonedigital
01-30-2002, 09:42 PM
That would be a good addition to Koolface animation area,
if you would like to send it to me...

bridelh
02-05-2002, 11:12 AM
Here's a simple cog/gears demo produced with Koolmoves V3 ActionScript. Uses just one MovieClip.

http://www.bridel.org/koolmoves/demo/cogs/cogs.html

Hilary

--

Bob Hartzell
02-05-2002, 02:23 PM
Very impressive.

johnie
02-05-2002, 04:01 PM
Originally posted by bridelh
Here's a simple cog/gears demo produced with Koolmoves V3 ActionScript. Uses just one MovieClip.

http://www.bridel.org/koolmoves/demo/cogs/cogs.html

Hilary

--

Show off :D

That is quite impresive... It looks like your having fun with the scripting.

bridelh
02-05-2002, 07:35 PM
Yes, Bob has done great things with Version 3 AS and MovieClip editing.

Just thought I would fire everyone up before the pending V3 release.

Anything should be possible with KM from here on in. I just need to find some artistic talent:)

Hilary

--

docree
02-05-2002, 09:14 PM
Hey cool... I like show-offs for new enhancements.

How about collision detection and dragable cogs/gears.
This could make a good puzzle game where you have to
drag gears in a certain pattern to turn a number of items
in the right direction.
Doc'Ree

Bob Hartzell
02-05-2002, 10:32 PM
Hilary has already created a movie using collision detection. Why don't you post it here and show off some more.

johnie
02-05-2002, 11:20 PM
you really should post that one too. It is really cool. Especially when you look at the scripting involved.

johnie
02-06-2002, 01:10 AM
Okay, I whipped up an example for everyone also, mine is a very simple game: http://www.jsnider.0catch.com/FunGame.html I used some of the script from Hilary's script and one I had sitting around on my machine. Its kind of fun. Try to score over 18 shots.

Bob C.
02-06-2002, 01:13 AM
Originally posted by bridelh
.........cog/gears demo produced with Koolmoves V3 ActionScript. Uses just one MovieClip.

Hilary

--

Very nice Hilary! I don't yet have a clue about actionScript but that is a very impressive demo.

johnie and Bob mentioned your collision detection movie. I'd love to see that as well!

Bob C.

johnie
02-06-2002, 01:34 AM
Originally posted by Bob C.
Originally posted by bridelh
.........cog/gears demo produced with Koolmoves V3 ActionScript. Uses just one MovieClip.

Hilary

--

Very nice Hilary! I don't yet have a clue about actionScript but that is a very impressive demo.

johnie and Bob mentioned your collision detection movie. I'd love to see that as well!

Bob C.



She posted it in this thread http://board.flashkit.com/board/showthread.php?threadid=262201

I might change my sample around a bit so that you shoot bugs instead of ballons I got some ideas just a momment ago. It will have to wait till tomorrow though.

JeffRussell
02-06-2002, 03:33 AM
guys when you post someone else work it'd be nice to mention the original author and the link to the work too.taking someone else hard work and passing it off as your own is blatant plagiarism.it is not right.this circle collision is take right out of actionscripts.org line by line word by word.it was originally done by flashjunkie who also has done some other great work.this is a copy and paste.even the headings are still entact.compare the scripts to see what i mean.
http://actionscripts.org/tutorials/advanced/circle_collisions/index2.shtml
i am sorry to be harsh but this is just so wrong.

johnie
02-06-2002, 04:07 AM
Originally posted by JeffRussell
guys when you post someone else work it'd be nice to mention the original author and the link to the work too.taking someone else hard work and passing it off as your own is blatant plagiarism.it is not right.this circle collision is take right out of actionscripts.org line by line word by word.it was originally done by flashjunkie who also has done some other great work.this is a copy and paste.even the headings are still entact.compare the scripts to see what i mean.
http://actionscripts.org/tutorials/advanced/circle_collisions/index2.shtml
i am sorry to be harsh but this is just so wrong.

Although her script is based off of the Actionscript.org code it is not the same.

This is the AS.org script:

Comment: ----------------------------------------------
Comment: start move
Comment: ----------------------------------------------
Set Variable: "my_radius" = (GetProperty ("", _width) / 2)
Comment: 'n' is always 'name' of circle.
Set Variable: "my_x" = GetProperty("",_x)
Set Variable: "my_y" = GetProperty("",_y)
Set Variable: "my_n" = GetProperty("",_name)
If (ymov="")
Comment: *********************************
Comment: ----------------------------------------------
Comment: first run through code,
Comment: this will initialize circle
Comment: ----------------------------------------------
Comment: *********************************
Comment: pick a distance:
Set Variable: "ymov" = Random(/:speed)+1
Set Variable: "xmov" = Random(/:speed)+1
Comment:
Comment: pick a direction:
Set Variable: "ysign" = random(2)-1
If (ysign=0)
Set Variable: "ysign" = 1
End If
Set Variable: "xsign" = random(2)-1
If (xsign=0)
Set Variable: "xsign" = 1
End If
Comment: adjust x and y movement
Set Variable: "xmov" = xmov*xsign
Set Variable: "ymov" = ymov*ysign
Comment: ----------------------------------------------
End If
Comment: *********************************
Comment: ----------------------------------------------
Comment: check edges
Comment: ----------------------------------------------
If (my_x<=my_radius+/:speed)
Set Variable: "xmov" = xmov*-1
Set Variable: "my_x" = my_radius+/:speed
End If
If (my_y<=my_radius+/:speed)
Set Variable: "ymov" = ymov*-1
Set Variable: "my_y" = my_radius+/:speed
End If
If (my_x>=/:movie_width-my_radius-/:speed)
Set Variable: "xmov" = xmov*-1
Set Variable: "my_x" = /:movie_width-my_radius-/:speed
End If
If (my_y>=/:movie_height-my_radius-/:speed)
Set Variable: "ymov" = ymov*-1
Set Variable: "my_y" = /:movie_height-my_radius-/:speed
End If
Comment: ----------------------------------------------
Comment: check for collision
Comment: ----------------------------------------------
Set Variable: "n" = 1
Comment: start checking for collisions
Loop While (n<=/:total_circles)
Comment: don't check myself
If (n ne my_n)
Set Variable: "n_x" = GetProperty("../"&n,_x)
Set Variable: "n_y" = GetProperty("../"&n,_y)
Set Variable: "n_radius" = (GetProperty ("../"&n, _width) / 2)
Set Variable: "delta_x" = (my_x+xmov)-(n_x)
Set Variable: "delta_y" = (my_y+ymov)-(n_y)
If ((delta_x * delta_x + delta_y * delta_y) < ((my_radius + n_radius) * (my_radius + n_radius)))
Comment: ----------------------------------------------
Comment: handle collisions
Comment: ----------------------------------------------
Comment: I collided with circle 'n'.
Set Variable: "nx" = Eval("../"&n&":xmov")
Set Variable: "ny" = Eval("../"&n&":ymov")
Comment: swap travel values with it.
Set Variable: "tempx" = xmov
Set Variable: "xmov" = nx
Set Variable: "../"&n&":xmov" = tempx
Set Variable: "tempy" = ymov
Set Variable: "ymov" = ny
Set Variable: "../"&n&":ymov" = tempy
Set Variable: "../"&n&":collision" = my_n
Else
End If
End If
Set Variable: "n" = n+1
End Loop
Comment: ----------------------------------------------
Comment: move me
Comment: ----------------------------------------------
Set Property ("", X Position) = my_x + xmov
Set Property ("", Y Position) = my_y + ymov
Comment: ----------------------------------------------

Which Absoulutly will not work in KoolMoves. I gurantee 1000% it won't work and I'll tell you why. KM, at least the version she developed it in, does not support Set Variable nor does it support ../ refrencing objects but rather only allows . referencing. You did not look at the script in question as this is her script which obviously is based on the public tutorial at AS.org but, not as you put it "line for line cut and paste of the tut":

// ----------------------------------------------
// start move
// ----------------------------------------------
my_radius = this._width/2;
// 'n' is always 'name' of circle.
my_x = this._x;
my_y = this._y;
my_n = this._name;
if (ymov == "") {
// *********************************
// ----------------------------------------------
// first run through code,
// this will initialize circle
// ----------------------------------------------
// *********************************
// pick a distance:
ymov = Math.floor(Math.random() * _root.speed +1); //random(_root.speed)+1;
xmov = Math.floor(Math.random() * _root.speed +1); //random(_root.speed)+1;
//
// pick a direction:
ysign = Math.floor(Math.random() * 2 - 1); //random(2)-1;
if (ysign == 0) {
ysign = 1;
}
xsign = Math.floor(Math.random() * 2 - 1); //random(2)-1;
if (xsign == 0) {
xsign = 1;
}
// adjust x and y movement
xmov = xmov*xsign;
ymov = ymov*ysign;
// ----------------------------------------------
}
// *********************************
// ----------------------------------------------
// check edges
// ----------------------------------------------
if (my_x <= my_radius + _root.speed) {
xmov = xmov*-1;
my_x = my_radius + _root.speed;
}
if (my_y <= my_radius + _root.speed) {
ymov = ymov*-1;
my_y = my_radius + _root.speed;
}
if (my_x >= _root.movie_width - my_radius - _root.speed) {
xmov = xmov*-1;
my_x = _root.movie_width - my_radius - _root.speed;
}
if (my_y >= _root.movie_height - my_radius - _root.speed) {
ymov = ymov*-1;
my_y = _root.movie_height - my_radius - _root.speed;
}
// ----------------------------------------------
// check for collision
// ----------------------------------------------
//n = 1;

// start checking for collisions
//while (n <= _root.total_circles - 1) {
for (n = 1; n <= _root.total_circles - 1; n++){
path = _root["colour" + n];
otherName = _root["colour" + n]._name;
// don't check myself
if (otherName != my_n) {
n_x = path._x;
n_y = path._y;
n_radius = path._width /2;
delta_x = my_x + xmov - n_x;
delta_y = my_y + ymov - n_y;
if ((delta_x*delta_x + delta_y*delta_y) < (my_radius + n_radius * my_radius + n_radius)) {
// ----------------------------------------------
// handle collisions
// ----------------------------------------------
// I collided with circle 'n'.
nx = path.xmov;
ny = path.ymov; //eval("../" add n add ":ymov");
// swap travel values with it.
tempx = xmov;
xmov = nx;
path.xmov = tempx; //set ("../" add n add ":xmov", tempx);
tempy = ymov;
ymov = ny;
path.ymov = tempy; //set ("../" add n add ":ymov", tempy);
//path.collision = my_n; //set ("../" add n add ":collision", my_n);
} else {
}
}
//n +=1;
}
// ----------------------------------------------
// move me
// ----------------------------------------------
this._x = my_x + xmov;
this._y = my_y + ymov;
// ----------------------------------------------


Now my sample is even further from either, in fact this is the Clip movement script that I used:

my_x = this._x;
my_y = this._y;

ymov += Math.floor(Math.random() * 5);
xmov += Math.floor(Math.random() * 5);

if (my_x >= 525) {
GotoandPlay("right");
xmov = xmov*-1;
my_x = 425;

}
if (my_y >= 375) {
GotoandPlay("bottom");
ymov = ymov*-1;
my_y = 375;
}
if (my_x <= 15 ) {
GotoandPlay("left");
xmov = xmov*-1;
my_x = 25;
}
if (my_y <= 15) {
GotoandPlay("top");
ymov = ymov*-1;
my_y = 25;
}
this._x = my_x + xmov;
this._y = my_y + ymov;

And I openly admit that I borrowed sections from her script. You do have a point about giving credit where credit is due but the two scripts are different enough that I am surprised that you actually are acusing her of plagerism.

Bob C.
02-06-2002, 02:33 PM
Didn't know that was collision detection. I actually saw and commented on the timing/sound etc. in the original post!

That is an awful lot of coding you people are showing! Not sure I want to (can) handle that. I did see some examples given at the KoolMoves site and might try that! (GROAN).

Posting here is soooo painful sometimes!

johnie
02-06-2002, 10:18 PM
Originally posted by Bob C.
Didn't know that was collision detection. I actually saw and commented on the timing/sound etc. in the original post!

That is an awful lot of coding you people are showing! Not sure I want to (can) handle that. I did see some examples given at the KoolMoves site and might try that! (GROAN).

Posting here is soooo painful sometimes!

Bob, the beauty of KoolMoves is that you can make things without knowing any code at all but its there if you need it. I have even seen games done without any AS at all. Although its been my goal since V 1.55 to make a shoot up game with KoolMoves, its just that I finally did it with V 3.0 b 6.

Mark's example uses much less scripting. The scripting is also very very close to Javscript.

Bob C.
02-07-2002, 04:01 AM
[QUOTE]Originally posted by johnie

Bob, the beauty of KoolMoves is that you can make things without knowing any code at all .........

Great johnie, very encouraging too. KoolMoves is keeping me busy getting familiar with all of its wonderful drawing capabilities.

I still can't believe I can make little movies with sound after so many years playing with .gif anims! TALKIES!!


Bob C.