The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.38 / 5.00 36,385 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.07 / 5.00 13,902 ViewsOops, ignore the first youtube tutorial that was a AS2 tutorial.
I think I also watched this initially.
Hmm.. well I guess you could say I started a couple of years ago, I had a go at learning as2 and I just couldn't get my head round it.. at all. Maybe it was due to the lack of direction, I felt lost when trying to get information, so I gave up pretty quickly after a couple of really simple making an objects move around with the directional keys type things.. that was pretty much copied code though. So I learnt next to nothing.
Then about a month ago now I tried getting into AS3. So first point of call was google, old newgrounds topics, kirupa etc.. Couldn't find too much at first but I read through the first little bit of that Essential Guide to AS3 and it starts you off with an OOP style approach, gotta say with no previous knowledge of OOP (even though it was pretty well explained) I was a little confused. But my main problem was I wasn't making stuff HAPPEN on screen enough which meant I wasn't learning an awful lot.
Then I turned to youtube actually, there's very little on youtube but just watching this and this gave me a nice starting point. Then I scrambled around Kirupa and Senocular's websites with little intros like this.
Now I had a nice little idea of what coding with AS3 actually was I could start learning about more specific topics. I used google in general along with Republic of Code to learn about variables, functions, if statements and the other basic building blocks (or "tools") which would allow you to actually produce something.
Now I had a decent idea of how to do things using actionscript, but there's one thing which kept cropping up which eluded me... classes, packages, or OOP in general.
So this was helpful in that regard.
Now I wanted to make something, and ASGamer had a great little series on how to make a rather simple game so I followed it, trying to take in all the information I could (and so going over some of the same bits multiple times) which taught me a good little amount more.
Now this is pretty much where I'm left a month on, and I still feel I need to learn more before I can actually call myself a AS3 coder or code anything of value, but compared to a month ago, I don't think I've progressed too badly :)
Good sources:
Senocular
Kirupa
Republic of Code
ASGamer
Google!! - search for [name of desired topic to learn about]+AS3
And of course these Newgrounds forums :P
Good luck :)
At 2/8/11 12:42 PM, Kirk-Cocaine wrote: It's so if you ever expanded your class you would have a way to access those properties should you want to.
Oh right, so would that be good practise.. or unnecessary most of the time?
And if you've used events you will have come across static variables. They're accessed through the class, rather than instances of that class.
Example...
And your code will still work fine. However if you were to type "Click" it wouldn't work. So to prevent typos and the like you can use static variables.
Oh well that's actually pretty simple :)
I've gotta be honest I'm finding it hard to understand the context of parameters and setters and getters or quite what these static const are as I haven't come across these before.
Just another note though, with Kirks example I don't see why the private variables were defined and used? What advantag/functionality do they have?
Now I've got the hang of this I made a class that was just made a circle, you can change the colour, size, x and y positions of this new object.
Using the same idea of the private variables:
package
{
import flash.display.Sprite;
import flash.display.Shape;
public class Magic extends Sprite
{
private var colour:Number;
private var size:Number;
private var positionX:Number;
private var positionY:Number;
public var myObject:Shape;
public function Magic (colourNumber:Number = 0, sizeNumber:Number = 1, positionXNumber:Number = 1, positionYNumber:Number = 1):void
{
colour = colourNumber;
size = sizeNumber;
positionX = positionXNumber;
positionY = positionYNumber;
myObject = new Shape();//explaaaain yurself!
myObject.graphics.lineStyle (1,1,1)
myObject.graphics.beginFill (colour)
myObject.graphics.drawCircle (positionX, positionY, 2*size)
myObject.graphics.endFill ()
addChild(myObject)
}
}
}
Ignoring their use all together:
package
{
import flash.display.Sprite;
import flash.display.Shape;
public class Magic extends Sprite
{
public var myObject:Shape;
public function Magic (colour:Number = 0, size:Number = 1, positionX:Number = 1, positionY:Number = 1):void
{
myObject = new Shape();//explaaaain yurself!
myObject.graphics.lineStyle (1,1,1)
myObject.graphics.beginFill (colour)
myObject.graphics.drawCircle (positionX, positionY, 2*size)
myObject.graphics.endFill ()
addChild(myObject)
}
}
}
They seem to do the same thing? (if you've already explained this part sorry I didn't understand)
Exactly what I was after thanks Kirk and nicely explained, it's nice to learn why it was wrong.
I only started learning AS3 a few weeks ago and had very little knowledge of coding before that but hopefully with a bit of practise I can have some reasonable knowledge in a couple of months :)
Ok well this is probably just a bit of a mess of code but I just was trying to be adventurous, I'm trying to understand how to code with OOP is as3 as it seems like the proper way to go about it.
So I decided after wondering through a few tutorials I'd try and make a class that draws out a circle or square which is either red or blue (although I've ignored that bit for the moment..) and it also has a variable size. This object is then placed on the screen at a random position.
Here's my Class
package
{
import flash.display.Shape;
import flash.display.Stage;
public class BORCOS extends Shape
{
//either Blue or Red (but at the moment just black for simplicity's sake)
private var colour:String = 1;
//either a Circle or a Square
private var shape:String = "Circle";
// this is the diameter of the circle or the width of the square, well i hope that's right at least!
private var size:Number = 1;
//creating my smexy shape with colour size and position
public function createShape():void
{
var myObject:Shape = new Shape();
myObject.graphics.lineStyle (1,1,1);
myObject.graphics.beginFill (colour);
if (shape == Circle)
{
myObject.graphics.drawCircle (Math.random(stage.stageWidth - 2*size)+size, Math.random(stage.stageHeight - 2*size)+size, 2*size);
}
else if (shape == Square)
{
myObject.graphics.drawRect (Math.random(stage.stageWidth - 2*size)+size/2, Math.random(stage.stageHeight - 2*size/2)+size, size, size);
}
//add the object to stage
stage.addChild(myObject);
}
}
}
So after making this class I'm hoping I can just input:
var myCircle:BORCOS = new BORCOS()
myCircle.colour (Red);
myCircle.shape (Circle);
myCircle.size (50);
And it would create a red circle of diameter 50pixels on the stage with a random x and y position (but not going over the stage boundaries).
Any help would be really appreciated, even if it's to tell me I've gone completely the wrong way about this! ^^
Well I've only recently started getting into AS3 and have found these few resources great for starting off:
Senocular
Republic of Code
AS Gamer
But these guys are right, after a starting off point like the first link I posted you can pretty much learn by Googling different bits and pieces after that :)
Good luck
At 2/4/11 05:27 AM, ProfessorFlash wrote: Nobody codes in ".as files". You are either doing OOP (object oriented programming) which means you use classes or if you have no idea what OOP is then you code in the fla.
*Heads over to Wikipedia*
Ah i see, so for larger projects coding using OOP is necessary as it's more organised and flexible, and potentially more efficient? Whereas if you simply had an animation and wanted to add a couple of buttons to it (or an equally simple project) then it would make sense to avoid going in that direction?
And I'm guessing lots other languages make use of OOP too so it's all good practise then.
Ok this has been bugging me a while so I'll ask you amazing folk :P
When is it good practise to write code singularly into the fla. file, and when should you program into seperate .as files?
Or should you always code into seperate .as files?
The way I see it you can code both ways and they will both work so I'm confused as to when to use which where, thanks :)
Just to give you some motivation, that first screenshot looks bloody awesome, i love how you've styled the people.
The idea of a working 3D flash fps makes me tingle inside :P
Ah thanks guys, one step at a time ;P
Right this seems really simple and silly but I've had a look at tutorials and can't seem to manage this, in essence all I want to do is make a dynamic text box show a numerical variable on the stage.
So I've made a dynamic text box with the instance name of:
myTextBox
Then I've added this code in the frame:
var textBoxValue:int = 5;
textBox.text = (textBoxValue);
So I'm guessing "text" isn't the right property to use? How do you do it?
At 1/26/11 12:14 PM, UnknownFury wrote: The stage is a displayobject, just like a MovieClip etc. So the width property is the same thing you'd get if you got the width of a movieclip. It's the width of all the stuff on the stage.
Ah I see thanks :)
As I've made this topic I'll add another question, what does:
stage.width
actually measure? I was using it instead of stage.stageWidth for a little before I realised it definitely wasn't giving me the width of the stage haha.
Ah so that's what the *= does, oh I see cheers UnknownFury.
I've got a good amount of the basics down (declaring functions, variables, packages, classes, adding event listeners etc), so the code no longer looks like a foreign language to me and I can see what's happening where in simple coding, but I am still at the start of my journey :)
Ok sure I agree tutorials shouldn't avoid explaining parts of their code, can you tell me at least what all the different operations such as jumpSpeed *= -1 mean? and the ==, =, -= etc?
Hey guys, I'm going over this Platformer tutorial (first page) and and I've understood everything... aside from the maths used in the jumping function.
I'm sure I could get the maths but I don't really know what's actually happening in the code as the author didn't explain, can someone help me out here? :)
//jumping function
function mainJump():void{
//if main isn't already jumping
if(!mainJumping){
//then start jumping
mainJumping = true;
jumpSpeed = jumpSpeedLimit*-1;
mcMain.y += jumpSpeed;
} else {
//then continue jumping if already in the air
//crazy math that I won't explain
if(jumpSpeed < 0){
jumpSpeed *= 1 - jumpSpeedLimit/75;
if(jumpSpeed > -jumpSpeedLimit/5){
jumpSpeed *= -1;
}
}
if(jumpSpeed > 0 && jumpSpeed <= jumpSpeedLimit){
jumpSpeed *= 1 + jumpSpeedLimit/50;
}
mcMain.y += jumpSpeed;
//if main hits the floor, then stop jumping
//of course, we'll change this once we create the level
if(mcMain.y >= stage.stageHeight - mcMain.height){
mainJumping = false;
mcMain.y = stage.stageHeight - mcMain.height;
}
}
}
Oh really? Well I have a er, friend, who has that book so I could probably get hold of it pretty easy so I may well check that out.
I flicked through it a little before but thought it was a little too abstract from a position of little to no experience, but I may as well give it a proper try thanks :)
Right so first off, I've read through the stickys and got an idea of starting points to AS3, but I'm sort of unsure the best way to start?
I've had a look at Kirupa.com and although they have quite a lot of helpful material but it seems rather scattered and unorganised (and outdated?) to be honest so it doesn't seem easy to follow. I'm rather familiar with flash itself and can code buttons and little simple bits and pieces but i'd say i was still a complete beginner.
Oh and my aim of learning AS3 is to be able to code games pretty much, and generally have a better understanding of programming as a whole.
So basically I'd love some advice on where to start, also I saw these books on amazon which seem like they might be the best way to get into AS3 programming:
ActionScript 3.0 for Adobe Flash CS4 Professional Classroom in a Book
Foundation ActionScript 3 Animation: Making Things Move!
What do you think guys?
Animators generally don't scan in images to animate as this is far more time consuming & laborious than either using a mouse or tablet. The animators that use this method don't do it because it's easier, they do it because they like the unique style it creates.
With practise you can become amazing using the mouse, few artists decide to go with it but it doesn't limit you, you'll just have to practise a lot.
Most artists go for the tablet because of the feel of it, it gives you freedom in a sense and makes it easy to draw curvy wavey organic shapes. It's not exactly like pen/pencil and does take a little time to get used to but most people love using them. You can either get a proper tablet (Wacom) which is quite expensive (though i definately don't regret buying one myself), or you can buy a much more affordable one at first to get the feel if it and see if it's for you and then think about investing in a wacom afterwards.
I do suggest investing in a wacom if you enjoy using a tablet though, they're faaaaaaar better than all the other random brands.
Ah sorry to say this collab probably isn't the best idea for me to be honest, I have exams throughout january so I'll only delay and hold you up :P
Maybe it's best to come back with a solo flash anyway, so hopefully another time, good luck :)
At 1/3/11 04:38 PM, Crowofthedusk wrote: theyll look better when animated. and i should add this now aswell but i dont have my tablet any more to drawon so i really can animate it myself. thats why i need another person, until i can get a new tablet then ill do it myself
Forget it mate :/
Sam wasn't being harsh or mean, he was being honest
Animation takes a lot of hard work and practise, you do it because you love seeing your ideas come to life and the satisfaction that comes with it, and that is why nobody is going to do it for you.
At 1/1/11 10:28 PM, Goat-Man wrote: Hm. I'll need a bit more than that to go by.
Even if it's something only like 10 seconds long. I just need a feel for you style and animating abilites.
The auditions will be open for a week, maybe two. So you have time
Ah I expected that to be honest, fair's fair I'll give it a go :)
Actually managed to dig up some old unfinished stuff:
Fiiiiirst
Secoooooond
4th.
Note: This stuff was done over 3 years ago, but I've barely touched flash since. So I'll be a bit rusty to get going but being 3 years older should make up for that. Tells me what ya think<a <a
Sounds like fun, plus the last 2 were pretty successful, gratz on that
Just gimme a little while to freshen up and ill show something :)