2,321 Forum Posts by "Musician"
Can somene please tell me how you find the values of poly and dis?
:"you then store it in an array with a refernence to the polygon: ie <arrayname>.push({dis:<the average distance>, poly:<the index in the polygon array for that polygon>});
:with that array you call <arrayname>.sortOn("dis",18); (18 means it is in descending order so the first item in the array will be the back polygon)"
you never exlaned where the values of dis and poly are stored, therefore I cannot have the faces layered by the value of poly because I don't know how to access it.
I need someone to help me with my many frustrations over AIM. my screenname is "MusicianMX".
by the way my many frustrations include 3d math, Array troubles, and Object troubles
At 10/21/05 02:42 AM, Reddz wrote: Man, and i wanted to do a game after the cartoon im making now... Looks like im fucked!
Not all games are as hard to make as this one, this one is hard because it is 3d and requires alot of manual programming for things flash normally could do for you if it was 2d.
thanx, but what did you mean by SIN 90?
Ok i need some help here, Im trying to develop a rotation equation for my game.
I've made a graph to help explain what I'm trying to find.
Now I've put down all the variables as letters so that I can transfer the equation into flash. but in this case I am trying to find fx and fy . you are given x ,y ,and n and also the origin is (0,0) .
since this is rotation we know already that since the radius is a constant that r = x + b. also since the whole rise/run thing can be drawn we know that 90 - n = the angle of the rise run triangle
So now if we just look at the rise/run formed triangle we know the hypotenuse and the arc tangent. If I remember the little trig I know correctly then fx = COS(rise/run triangle) and fy = SIN(rise/run triangle).
So how can I find the SINE and COSINE of a right triangle when we know its hypotenuse and arc tangent?
thanx, just so you know though I'm using actionscript 2
//[z,y,x]
_root.createEmptyMovieClip("holder", 0);
grid = [[-5, 0, 0], [0, 2, 0], [0, -2, 0], [0, 0, -2]];
for (i=0; i<4; i++) {
var a:Object = _root["point"+i]=new Object();
a.z = grid[i][0];
a.x = grid[i][1];
a.y = grid[i][2];
}
_root.onEnterFrame = function() {
for (i=0; i<4; i++) {
scale = 500/(200+_root["point"+i].z);
_root["point"+i].rx = scale*_root["point"+i].x;
_root["point"+i].ry = scale*_root["point"+i].y;
}
//API draw the shape
_root.holder.lineStyle(1, 000000, 100);
};
trace(point0.rx);
K new problem when I trace point0.x I get a defined number, however when i trace point0.rx I get an undefined value. since x is declared in the first for loop and rx is declared in the second I assumed the problem was there.
for (i=0; i<4; i++) {
scale = 500/(200+_root["point"+i].z);
_root["point"+i].rx = scale*_root["point"+i].x;
_root["point"+i].ry = scale*_root["point"+i].y;
}
I also tried tracing scale which has an undefined value too. since every number in the scale equation is a constant except for "_root["point"+i].z" that must mean that it is the problem. However we know that z is declared because when we trace it it has a defined number.
And anyhow even if the number was undefined it would have scale traced as either infinity or isNAN. so the problem must be in the for loop or the onEnterFrame event. since if the loop had a problem it would almost definently show up on a syntax check it must be the onEnterFrame event
So whats wrong with it?
No that didn't solve the problem, but thankyou for saving me some trouble.
onClipEvent (load) {
speed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x -= speed;
}
if (Key.isDown(Key.RIGHT)) {
this._x += speed;
}
if (Key.isDown(Key.UP)) {
this._y -= speed;
}
if (Key.isDown(Key.DOWN)) {
this._y += speed;
}
}
first you forgot to put the key detection code inside of the onEnterFrame event. When something is outside of an onEnterFrame event it will only occur/check that code once. whilst if you put it inside the onEnterFrame event, it would repeat.
Seeing as the key detection code was outside the onEnterFrame event it would only run through it once, making it so that even if you character was able to press the arrow key within the 1/12 of a second that he was given (which I doubt he could) it would only move ten pixels at the very start of the game and there would not be a noticeable difference.
Read my explanation for you problem or not that code above it should work.
//[z,y,x]
Grid = [[-5, 0, 0], [0, 2, 0], [0, -2, 0], [0, 0, -2]];
for (i=0; i<4; i++) {
_root["point"+i].z = Grid[i][1];
_root["point"+i].x = Grid[i][2];
_root["point"+i].y = Grid[i][3];
}
trace(_root.point1);
K so basically thats all I've written so far and the output window says that _root.point1 is undefined. Is there a problem with the way I'm declaring my variables?
At 10/11/05 12:45 AM, CAP_FLASH wrote:
He has also worked with Riftmaster of www.ETGAMES.com
Yeah but nowadays RiftMaster works with a much more talented artist.
err... its not on newgrounds... its on ETGAMES.
At 9/28/05 08:49 PM, Sugggames wrote:At 9/28/05 08:41 PM, MusicianEXE wrote: Just IM me I'll help you out. Everyone else, go fuck yourselves. If a n00b needs help you help him in the same manner that people helped you when you were a n00b.noone helped me when i was a n00b.
I tought myself flash in two years.
2 years? I find that hard to believe
Just IM me I'll help you out. Everyone else, go fuck yourselves. If a n00b needs help you help him in the same manner that people helped you when you were a n00b.
I dunno if this should be on the programming forum or the flash forum, but did anyone ever wright a tutorial for people who want to jump from actionscript to C/C++ without having to dig through a book filled with crap they already know like "if" statements and "for" loops.
I'm taking a C++ course and I wan't to have a head start before the class begins.
this is perfect for what I'm trying to do... (bookmarked)
At 9/4/05 10:39 PM, jeremysfilms wrote: You want a good A.I. code?
Convert something to a movie clip. then name it 'pow' for an instance name.
Now give it these actions:
for(pow=0;pow>999999;pow++){
trace(pow)
}
ooh yeah I've tried that before, that makes awesome AI ;)
AI is easy, its all just programming your enemy to have certain logic. If you want to have insanely smart enemies you'll take it to a level of emotion even and define variables that will make out his reasoning like
var fear
var bravery
var suspicion
var experience
var grudge
var reasoning
I dunno how youll determine what these will be set to but I know that you can use them to determine different actions
like...
if(fear > 0){
reasoning -= fear
}
less reasoning and more fear may make him shoot in random places or lose control and accidentally gun down his team mates. I've never finished one of these engines but this is how I plan to make my enemies.
god it sucks having to wait.
ok so then after some searching I stumbled across something like this...
var game:Object = new Object()
game.Tile0 = function() {}
game.Tile0.prototype.walkable=true
then later in the code the author calls on it like this...
createEmptyMovieClip("holder",d++)
game.clip = _root.holder
game.movieClip = new game.Tile0
game.clip.attachMovie("Clip","movieClip",d
++)
so could you kindly explain what the prototype class is, and also is this (new game.Tile0) making an instance of the tile0 function?
At 9/4/05 07:23 PM, Denvish wrote: AFAIK, clip events only work with Movieclips
Damn that sucks.... what does AFAIK mean?
I don't think so, but I could be wrong
Damn again, but I guess it makes sense if your right about the first question
Never heard of these. Where did you hear about them?
well, I know that they are used in C/C++ and JavaScript so I figured flash would have them too seeing as the actionscript is just C/C++ code with built in functions that can work with its visual part. but If I can't have clip events in an object it's pointless anyways.
Is there anyway to put updating code inside of an object...maybe A while loop?
why does no one respond?
first question
var tileOne:Object = new Object()
tileOne.onEnterFrame = function(){
<code here>
}
Can you have clipEvents inside of objects like so?
second question
_root.tile.<give tileOne objects's code>
is there a way to copy an objects code into a movieclip (not just variables)
final question
I've heard about things called pointers, that can point to objects. Would these be of any relevance for what I want to do?
I need help dammit!
LEIK CAN N0 0NE HEPL ME TEHN??
ZOMG LEIK CAN J00 EXPLIAN HOW TU USE POINTERS IN FLASH???!!?1111 OMFG!! LOLZ
At 9/3/05 08:24 PM, Ninja-Chicken wrote: Im thinking of getting back into 3D (just to mess around with really)
And I used calligari truespace (cos I couldnt be bothered with maya) and here
is some images that took like 10 mins
um...does this even belong on the flash forum? anyways dude I havn't done 3d art in like years but you should learn to transform single shapes so that you don't have to combine other shapes, then just google some textures and use them to make them look more detailed. but yeah, those pics suck.
o well, thanks for trying but that has nothing to do with objects and pointers. It's ok though its a really weird concept and I don't really understand it completly yet. I can figure it out on my own, no need for people to waste their time...
so, no one knows then?

