323 Forum Posts by "PCpr0gramer"
It's not a collaboration, it's a project proposal. I'm looking for an independent contractor.
I posted this project on flashgameart, if anyone is interested. http://flashgameart.com/project/396/
Character animation (jumping, hanging against the wall, running), game elements (jump pads, water, crumbling land), enemies, and I suppose level design. I will compile these elements into the final game.
Oops! Above link to engine is broken. Use this one: linky.
Hello Newgrounds, I'm Ian Adam from the moss/lint series. I have a new extensible platformer "engine" and am looking for a graphic artist/animator to work on the creative bits to turn it into a game. The game will be finished no later than the end of February, and pay will be around $250 (to be disbursed upon completion of the game).
If interested, leave example work in this thread, or email me directly at ianadam.games(at)gmail.com.
Thanks!
-Ian Adam
Word. I guess maybe I'll hire a graphic artist and animator and just let them go to town.
Has anyone had any luck selling a flash game engine, or the rights to develop under said engine? I've just developed a platformer engine but don't really have time to finish any games for it.
On a related note, is there anyone out there who is interested in buying a game engine similar to the one from my moss/lint series?
Thoughts?
I give you sir, one internet.
Thank you, that was it. I swear I tried that multiple times, but I must have syntax error'd somewhere.
Thank you.
At 8/12/09 08:32 PM, hesselbom wrote: So like a class with a couple of static methods? That is still pretty basic, actually.
package
{
public class Physics
{
public static function methodName (a : Number, b : Number) : Number
{
return a + b;
}
}
}
Sorry if my ActionScript syntax is a little rusty. Anyway, if you put a class like that in your root folder/package you will be able to access it from anywhere, like
var something = Physics.methodName (1, 2)
@zuperxtreme
Right idea! Wrong implementation... That is what I'm looking to do, it just doesn't work that way. Thank you very much though.
@ the guy above, no -- that's not what I'm going for and I do understand OOP, I'm quite adept at C++, this is just my first attempt at AS3.
I'll keep looking, I'm sure it's a pretty common thing to do.
Really what I'm looking for is a way to make a "library" of common physics functions like vector addition, dot product, etc... and to be able to include them anywhere and use them in a way like the Math class.
That was allowed before as3, but now (as I understand) the Math class can not be extended. That code yields the error:
1016: Base class is final.
I was thinking more, how would I create a class (as for vector functionality) and use it in another class (as for use in a ball MC).
I have the ball MC working as type "Ball" (from class Ball.as). How would I create a class, "Vector" for use in class "Ball" (or any other class for that matter)?
Here's one: If I wanted to add vector addition functionality to AS3, how would I do the equivalent of extending the math class to get something like...
velocity = Vect.add(vlocitya + velocityb);
I get the logic there. I tried including the class file at the top of ballA's class with
import ballB;
and later using ballB's function
ballB.updatePosition();
but I get the error message: 1061: Call to a possibly undefined method baller through a reference with static type Class.
Any ideas?
Hello all,
I'm introducing myself to AS3 and I've run into a problem.
Say I have two classes, each linked to an object on the stage. One class called ballA, the other ballB.
If ballB's base class contains the public function updatePosition(), is it possible to access that function from within ballA's base class?
Thanks,
Ian
When colliding two objects and having them move away from each other so that they are just barely touching, sometimes flash lets the objects overlap in one frame and then shows their correct positions in the second. Other times it seems, flash computes the correct positions and then displays their positions. Is there any way to make it so that the objects do not re-display until their correct (non-overlapping) positions are processed?
While your solution was not dead on, it did lead me to transformation matrices, and essentially the system works like this:
First, the angular distance between the point to be reflected and the line over which it is to be reflected must be determined (this is assuming the line's y-intercept lies at 0).
point A = (0, 1)
line Q = y = x
The difference between the angular measurements of these two objects is 45 degrees.
Doubling this, we get the rotational difference (and thus the rotational difference): 90 degrees.
Next a transformational matrix is used (see included picture) to determine the new x and y coordinates of the point (x' and y').
I hope this helps everyone out there (doubtfully) who needs this kind of information.
Thank you so much, but could you slow that down a bit (if you have time).
That would work if I was doing it graphically, but I need a way to do it with math entirely. Thank you very much for the reply though.
It allows you to test a single point against a shape. It's useful for shapes that aren't squares, like circles or other oddies. The format is this (assume the object to be tested is a circle, and we're testing it against the x and y position of a bullet.)
if(circle.hitTest(bullet._x, bullet._y, true)){
}
That's for AS2.
I'll include a picture to aid in discussion. Anything is helpful, even a resounding, "You've got me!" is reassuring.
For the past two days I've searched for the method to reflect a point ie: (-1, 3) across a line ie: y = 1/5x. Any help or direction would be greatly appreciated.
Thanks,
Ian
I have vars set as my document class. The code in the class vars is:
package {
import flash.display.*;
import flash.events.*;
public class vars extends MovieClip {
var jackson:Number = 3
trace(jackson)
}
}
When I run the program I get the following error, "1120: Access of undefined property jackson."
I know it's a simple fix. What is wrong?
Thank you for the reply. Unfortunately, getClassByName() no longer exists. getDefinitionByName() replaces it I believe.
Instead of doing that, I used a switch statement. It's kind of dirty, but it's solid.
Thanks again for the reply.
Hey there,
I'm working on the new game in the *oss series and I'm converting everything to AS3. Horray! I'm dynamically loading a "piece" of ground from the library. Each ground piece is a different class and I want to know a faster way to load each piece at the appropriate time than to call for instance,
g1 = new ground1e1();
addChild(g1);
//then level change
g2 = new ground1e2
addChild(g2)
I was thinking something along the lines of.
this["g"+i] = new this["ground1e"+i]();
addChild(this["g"+i]
But that's just too logical.
Any ideas?
At 4/23/08 04:26 PM, mike wrote: sorry, I omitted some stuff while typing it up. :) Try:
package {
import flash.display.*;
import flash.events.*;
public class MyClip extends MovieClip {
public function enterFrameHandler(e:Event):void {
x++;
}
public function MyClip():void {
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
}
To use classes in a different package (which is all of the built-in classes), you have to import them. Also, classes have to be inside a package to be externally visible, and you need to set your class as "public". Good luck! :)
Woot. That did it. Thank you very much. Mike, I see you have a special icon and you've been around since 2000. Are you a founding developer, or just a faithful user?
My current code:
import flash.display.*;
import flash.events.*;
class MyClip extends MovieClip {
public function enterFrameHandler(e:Event):void {
x++;
}
public function MyClip():void {
addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
}
Now I've solved the event problem, but I get a new error:
5007: An ActionScript file must have at least one externally visible definition.
Whats that all about?
At 4/23/08 03:45 PM, mike wrote: Sure thing! You'll need to make a separate AS file, called, say, MyClip.as. You can throw the above code in there. "class MyClip extends MovieClip" means that MyClip inherits all of the MovieClip properties -- literally, it is a specialized MovieClip. The constructor (function MyClip()) creates the enterFrame event listener. This event automatically gets triggered every frame. enterFrameHandler handles the event and changes the position of the MovieClip.
In Flash, you'll want to right click on a symbol goto Linkage properties, export it for AS, and set its class name to MyClip. This binds that art to that class name -- whenever you create a MyClip (whether by placing it on the stage or doing "new MyClip()" in AS), it will use that art.
Allright, I have all of that in place, but when I run the program I get these two errors:
1017: The definition of base class MovieClip was not found.
5000: The class 'MyClip' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
now if I add:
import flash.display.*;
to the top of the class, those two errors get replaced by
1046: Type was not found or was not a compile-time constant: Event.
Thank you for your help! I've almost got it.
That second one looks like its what I'm looking for, would you mind breaking it down a little?
I'm learning AS3 and I'm wondering how to trigger an event every frame using classes. To keep it simple: How would I make a class to move every MovieClip's x to the right every frame?
I've learned how to trigger an event once, as soon as the MovieClip has been made with a class, but every frame. Any help?
I've found a solution to my problem through an array. I pass the name of my object through the array and set it to call the function from the main timeline. It's effective.
One more question:
I haven't experienced any lag with AS3 so far, what exactly makes it so much faster than AS2?
At 4/22/08 01:05 PM, GustTheASGuy wrote: It's because they're strictly typed and the properties of the subclass you define aren't implied by DisplayObject. Therefore you need to 'MyClass (root).property' cast it. Or even better, don't use those properties at all. They don't make sense in OOP perspective.
I'm having a hard time grasping the way AS3 expects me to make objects modular. I used to be able to drag an item such as a pendulum from the library, on stage and it would work because I put code in the pendulums timeline that called functions on _root. What should I do now?

