Be a Supporter!
Response to: As3, Fd, And Oop The Right Way Posted October 5th, 2012 in Game Development

I only quickly glanced it through so I can't comment on the content, but it seems you've put a lot of effort into this! Good job. Nice to see passionate people like you. Hopefully someone who does read your tutorial (or watch the video) will learn from it. :thumbsup:

Response to: Turn-based Rpg Character Stats Posted October 4th, 2012 in Game Development

At 10/4/12 10:04 AM, inquisitorlee wrote: Btw, what if I make permanent value changes in the character class like the same changes I made on the instances?

That doesn't make any sense but I'm gonna take a guess and you are talking about what if you modify the values of the passed reference "playerInstance" inside the function, will it affect the original instance? And the answer to that is yes. When you pass the "playerInstance", you are passing a reference of the original instance. It is not copied, it is the one and same instance just referred now with a different name (thus called reference).

Response to: [AS3] Rounding a number Posted September 26th, 2012 in Game Development

At 9/26/12 08:08 PM, jaksmillie wrote: Hey guys I have this script here that I have been working on, and for the past hour I have been trying to figure out how to make it that so everytime I multiply the 'healthCurrent' variable by .8, then if the output contains decimals, well it gets rid of the decimals and rounds it to the nearest number. I have tried using math.round

How did you fail in using Math.round? It does exactly what you want and couldn't be simpler to use. Your current code doesn't contain any rounding so I can only tell you what you know; use Math.round.

Response to: .as file with static vars [global] Posted September 25th, 2012 in Game Development

At 9/25/12 04:00 PM, zeefoes wrote: Does anyone else use a single .as file with a bunch of empty static variables to store information globally across all classes? I find this really easy as I don't have to pass down anything, I just reference Globals from deep within class hierarchies.

Why are they empty? It would make sense if they hold constant values.

I wrote really long ago a static class that I called "Registry" that had simple functionality to add name / value pairs (name:String, value:*) and then retrieve the value based on the name (also check if value existed and something else too). I used it in one project that I didn't finish. I haven't used it in any other project because I never felt that I needed something like that.

Response to: Ad's Gone Black Posted September 23rd, 2012 in Game Development

Well you know once you go black, you never go back. Hahahaha :D

Response to: Enter_Frame calling loop function. Posted September 22nd, 2012 in Game Development

At 9/22/12 01:33 AM, Barzona wrote: So, how do I make the loop execute once per frame until it reaches it's cap?
//enterframe
num++;
if (num < 4) {
runMyStuff();
}
Response to: How do you protect your Flash? Posted September 21st, 2012 in Game Development

How to protect your flash? Slam all the code in your main class and hardcore values as much as you can and use single letters for variable names that you only remember for 24 hours. That's how I roll.

^^
Response to: Array in For Loop Posted September 21st, 2012 in Game Development

Trace the player1array after using the split. See what it holds inside.
Also your code inside the loop doesn't make any sense. Please explain it line by line.

Response to: Random Code Posted September 21st, 2012 in Game Development

If you don't want options to repeat, then use an array to remember what options have been used. Simple thing to use is an array that is the length of the amount of options (15) and populate it with the boolean 'false' and simply set the appropriate array slot value then to 'true' when it gets used. Check with a loop that the newly selected option isn't used by checking if the corresponding array value is 'true' or 'false'. In case of it being 'true', select a new random number until you get an option that still holds the value 'false', etc. etc.

Response to: Functions in a seperate class file. Posted September 21st, 2012 in Game Development

If you have functions that are not depended in anyway with the main class and just perform a simple task with a return value, then by all means move those functions into a "helper" class. Example being if you want to calculate the average of several number values and have a function for that, you might as well move it somewhere else if you feel that your main is getting cluttered with code.

Response to: Flash Cs5 Stage (easy Question) Posted September 19th, 2012 in Game Development

Enable rulers and then drag them from the sides.

Response to: Starting on Flex 4.6 Posted September 18th, 2012 in Game Development

At 9/18/12 01:25 PM, Knight52 wrote:
At 9/18/12 01:17 PM, ProfessorFlash wrote:
There is a <fx:Script> tag that allows you to write normal as3 code inside of it. Start writing <scrip and just hit enter and it will generate you the code block where you can write as3.
I got that part. What I don't know is how to get the screen's sprite and add "main" sprite into it.

I'm guessing you haven't set up a function to run at start up? You can do that like this, at the of the <a pplication> tag add one more property to it applicationComplete="init()". "init()" being the function you want to run.

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
			   applicationComplete="init()">

Then just write as3 normally. If you got a class called "Main" that you want to add:

private function init():void
{
var m:Main = new Main();
addChild(m);
}
Response to: Starting on Flex 4.6 Posted September 18th, 2012 in Game Development

At 9/18/12 01:07 PM, Knight52 wrote: This might not belong here, so sorry if it really doesn't.

I'm working on a mobile app. That means I have to link AS3 code to that mxml file. I can do AS3, but I don't know what to do with that XML file at all.
What I want to know is how the should I add the "main" sprite in AS3 code to the damn screen.

There is a <fx:Script> tag that allows you to write normal as3 code inside of it. Start writing <scrip and just hit enter and it will generate you the code block where you can write as3.

Response to: Projectile problem Posted September 18th, 2012 in Game Development

You haven't defined "direction" variable anywhere.

var direction:Number = 0;

And btw, you posted this same problem over a week ago, and I told you to put your moving code in an enterframe but you haven't done anything; your code now is exactly same as before. Are you even trying to solve your own problem? To me it looks like you are looking for a copy/paste answer. Just saying that it doesn't look like you are learning anything here.

Response to: Pokemon Mmo Looking For Helpers Posted September 17th, 2012 in Game Development

How are you going to attract people in to this massive project without payment?

Response to: Best way to print players score? Posted September 15th, 2012 in Game Development

At 9/15/12 02:06 PM, blank0000 wrote: Hello NG!

A simple enough thing, I just don't know how to do it. I have a score counter for the player, I want to print it to the screen
so they can know their score. How should I go about doing that?

How about a textfield?

jesus
Response to: Help to make a boomerang - AS3 Posted September 13th, 2012 in Game Development

The code you posted isn't moving the bullet? Because the information you need to know, is the vector of the movement. Essentially this means the same as knowing the angle where the bullet is going, and knowing the angle of the return point (=starting point) from the bullet. Once you know these two, you can add/subtract a value from the direction angle until it turns towards the return angle (this happens over time in enterframe so it looks like it curves). There's the basics of your "boomerang". Try to code it and come back if you need more help.

Response to: How can I delay shell ejection Posted September 12th, 2012 in Game Development

At 9/12/12 02:55 PM, dfkgjhsdg wrote: Thanks. Where should I put that piece of code in order for it to work with the shell ejection?

Umm...what? My answer was as simple as it gets. Do you have any actionscript knowledge?

Response to: How can I delay shell ejection Posted September 12th, 2012 in Game Development

At 9/11/12 10:04 PM, dfkgjhsdg wrote: I didn't manage to get that to work. Does anyone know a specific piece of code to put into madness interactive to get delayed shell ejection.

You can also put a running number in your enterframe handler and run the actions when the number reaches what you want. Obviously remember to reset the number when you want to do it again.

num++;
if ( num == 100) {
//do stuff
}
Response to: The Flash 'Reg' Lounge Posted September 9th, 2012 in Game Development

At 9/9/12 09:52 AM, 14hourlunchbreak wrote: If I go directly to sponsors would they want me to name a price?

Yes. From my experience every sponsor (that is interested ofc, that's 2%) will reply to you something like "nice game, how much you want for it?". And if you give them the 'im not sure' kind of answer, they most likely will not reply back to you. Ofc it will be the same case if you price it too high for them. So pretty much you can never win with the sponsors, they got so many games offered to them they can just pick the cheapest quality games they get offered. The sponsorship scene used to be much better like 5 years ago, probably cuz there wasn't so many developers back then. Today if you make a good game (good, not great) you will be fighting for scraps (talking like 200-400$ price range). It's sad :(.

Response to: Projectile Problem [as3] Posted September 9th, 2012 in Game Development

At what event is the "shootFireball" function triggered? Since you are also creating the fireball in that function, I'm guessing it's something that fires once? Because if you want to move something constantly, you need to run the moving code either on a fast timer or more commonly on an enterframe event. You obviously aren't doing that if you say your object isn't moving.

Response to: Undefined Property Posted September 7th, 2012 in Game Development

Your logic is flawed, and there is no need to get mad at me when I point it out. The problem is very clear when looking at your code. I don't know why you think it was unnecessary to post it, it is the key to everything.

You are adding two event listener that are the same to the same object, yet you want to access variables as if they were all in the same function. What is the logic behind adding two enterframes into the same object? Bingo, there is none, your logic is flawed, don't get mad, we all started someday and weren't so good at it. Don't think I'm being hostile, try to learn instead.

Your solution is to combine the two enterframes into one enterframe function. Define the 'pointer' variable outside of the if's, so you can use them in both. Variables defined inside a function are 'local' variables, you cannot access them outside of the function and they are destroyed when the function runs to the end. That is the reason why "flash refuses to work like you want it to". Your attitude towards coding is silly if I may point out. Flash isn't refusing anything, you are just doing it wrong.

Response to: Undefined Property Posted September 7th, 2012 in Game Development

At 9/7/12 05:53 PM, Monsie wrote: How do I get flash to understand this?

How do you get a programming language to accommodate to your flawed logic?

Now if you want some actual help, maybe post the code parts that are giving you trouble and we can see how to fix it.

Response to: Where save a table of ratings Posted September 5th, 2012 in Game Development

I'¨m guessing you are talking about highscores here? In that case I recommend mochi. It's really easy to use.

I suppose since we are at NG right now, I should mention that they offer this kind of service too, but I haven't used it so no comments on it. So you could check the NG API too.

Response to: Flash 8 vs. The World Posted September 3rd, 2012 in Game Development

It doesn't matter.

Response to: currentFrameLabel not changing! Posted September 1st, 2012 in Game Development

At 9/1/12 06:59 PM, blakemoso wrote: Is there any way to get all of these frames to share the same label without actually typing it into each frame?

Ok I see now, and the answer is no. People don't really use framelabels. It's easier to check the frame number. And in your case if the "moving" frame is frame 20, and you want to check when you are frames after that, then you use a simple if (currentframe >= 20). Drop framelabels from your coding habits :). There is only one reason you would ever use a framelabel, and it's not that great then either.

Response to: currentFrameLabel not changing! Posted September 1st, 2012 in Game Development

I didn't quite follow you on your explanation of the problem. I'm gonna take a shot in the dark here and tell you to change the gotoAndPlay into gotoAndStop and see if that fixed your problem?

Response to: Hit Test after scaling Posted September 1st, 2012 in Game Development

How wide is the barrier and how fast are you moving the enemies and what is their width? It really just comes down to numbers. If you move something that is 5 pixels wide with the speed of 10 pixels, then you can pass a 5 pixel wide barrier without touching it.

Response to: The Flash 'Reg' Lounge Posted August 31st, 2012 in Game Development

I've returned. I doubt anyone noticed, but I'm announcing my return anyway :). Got caught up playing a lot of golf this summer. I thought I would drop my handicap from 20 to 10 easily, but it turned out harder than expected. It seems difficult for me to have a consistent good 18 holes. I usually do very well during the first 9, but then fall apart towards the end. Such a mental game, and I apparently have mental problems :D. Well managed to get half way to my goal regardless, so I'm at 15hcp atm. I guess I can be happy for that. Make up the rest next summer. Any other golfers here btw?

Response to: Event Listener For Mc Frame Posted August 31st, 2012 in Game Development

Yes you can dispatch an event when the mc playhead reaches a certain frame. Example code:

//maintimeline code
var myArray:Array = new Array();

mc1.addEventListener("complete", myActions);
mc2.addEventListener("complete", myActions);
mc3.addEventListener("complete", myActions);

function myActions(e:Event):void
{
myArray.push(e.currentTarget as MovieClip);
}
//code on the mc1, mc2, mc3 frame where you want to dispatch the event
var ev:Event = new Event("complete");
dispatchEvent(ev);