Be a Supporter!
Response to: Need help with a button code Posted January 11th, 2014 in Game Development

At 1/11/14 12:14 PM, roxasreaper wrote: I appreciate the help but your code kind of confused me, I guess I'm not used to that kind of code lol

I essentially gave you the solution with your variable names omitted and in place of them, more generic names along with commented descriptions of the logic you need to do in certain cases. If you don't understand the "//" either, then I'm going to have to point you to beginner tutorials because comments should be one of the first things you learn.

If you're not used to "that kind of code", then what kind are you used to? This thread doesn't need so many replies for you to deal with a simple if/else case.

Response to: Domain Name Owner Posted January 11th, 2014 in Programming

At 1/11/14 11:01 AM, DannyIsOnFire wrote: So my question, who's is the domain name now? My clients the one listed as registrar but the other person actually bought it and doesn't want to let it go. Any ideas?

Haven't seen you in a while.

I would've thought it'd be the person on the whois lookup (although I've known people to fake this information). Was a contract written up when the client employed the other person? Did he buy the domain under the instruction of the client? Sorry I can't help too much, could be an interesting discussion, though.

Also I think I had a website on a subdomain of your website at one point.
Response to: Need help with a button code Posted January 11th, 2014 in Game Development

At 1/11/14 10:33 AM, roxasreaper wrote: So Ive been working on a new game for a while now and everything was going swell, I was really happy with how it was turning out, when suddenly one of my buttons within the game decided not to work properly. It is a very important piece to the game, it is a button you click on to purchase Hp within the game, but once you hit a certain amount of Hp its not supposed to let you buy anymore, yet it lets you continue anyway.

Heres my code so far:

on(release){
if(_root.Coins>=30){
_root.Coins-=30
_root.Hp+=20;
}else if(_root.Hp>=200){
_root.Coins-=0
_root.Hp+=0;
}
}

You don't understand how if/else works. The first case is always matched so the second won't ever be reached.

Maybe something like

on(release)
{
    if(coins >= 30)
    {
         // can afford
         if(health < 200)
         {
              // health isn't max, allow to buy
         } 
         else
         {
             // health is max, don't allow to buy
         }
    }
    else
    {
        // can't afford
    }
}

Now I look at it, it's pretty messy, but it should work.

Response to: The Flash 'Reg' Lounge Posted January 11th, 2014 in Game Development

At 1/11/14 10:35 AM, TheNavigat wrote: Not done yet, apparently, but here.

Looking very nice.

ACCOUNT DELETION.
Does anybody else think there should be a law in place that means websites have to have an account deletion button in a clear place that actually deletes the account? I've had "deactivated" accounts, and the website emails me out of the blue. Really bothers me.

Response to: 2nd monitor for coding? Posted January 11th, 2014 in Game Development

I've had two monitors, both landscape and also tried the one landscape and one portrait. I'd definitely recommend the latter setup for programming. If you use it a lot more for media consumption or as a general purpose monitor, it takes a bit of getting used to.

Right now I've got one monitor out of choice, I feel I get more done because I'm more focused on the task.

Response to: Printing .swf in Flash 8 using AS2 Posted January 5th, 2014 in Game Development

Completely misunderstood your question OP, my bad. Kkots reply seems very useful.

Response to: Printing .swf in Flash 8 using AS2 Posted January 5th, 2014 in Game Development

At 1/5/14 07:33 AM, Azmarith wrote: I've followed the tutorial on the forums, and when I run the function it comes up with the option to print, however the task is never sent to the printer. Does anyone know how to fix this problem?

I've not dealt with directly printing from Flash. Have you tried exporting as an image and printing via your operating system?

Response to: Subtitles in SWF files. Posted January 3rd, 2014 in Game Development

The easiest way would be to have a movieclip and inside it a text box and manually change the text when the right frame comes. The movieclip would sit on the main timeline. You could have separate ones for different scenes, or simply use a bit of ActionScript to tell the subtitle movieclip where to start from when a new scene starts. Hiding it would then be something like this:

mySubtitleMovieClip.visible = false;

I'm sure you can figure out how you would show the subtitles after they've been hidden :)

Response to: The DotA 2 Alliance Posted January 2nd, 2014 in Clubs & Crews

At 1/1/14 05:14 PM, MSGhero wrote: The Lord of Olympia has assumed his place as my highest kda ratio at 36/0. Match 450390040

Kill stealer, ain't ya. ;)

At 12/31/13 03:18 PM, kirby1837 wrote: everytime i play the weaver guy i snowball out of control.

i think he is genuinely op. his ult purges dust track and amplify it works as a get out of jail for free card and a way to get back into the battle after dying with buyback. and od is just a bitch to lane against with this astral imprisonment.

I agree with MSGhero, heroes like Weaver, Ursa and Shadow Fiend were really popular back when the game was fairly new. No one in pubs knew how to play against them very well so they would call them OP. In all honesty I don't think any hero is OP, it's just a case of people not knowing how to deal with them.

Response to: Math.random to pick player turn Posted December 29th, 2013 in Game Development

At 12/29/13 07:41 AM, kkots wrote: Are you talking to yourself?
What exactly is your problem?
Post FULL code. EVERYTHING. And point to where you think the problem is using comments.
I can't make sense of your "bed" problem. Do not go off-topic.

You have a very blunt attitude. His problem seems fairly straight forward.

To the OP:

Think about this logically, how often does the calculation to pick the first player occur? Only once, right? Enterframes happen every single frame of your game, so that can't be right. Turns after the initial turn are worked out automatically, the player that isn't the one who just had a turn, now has their turn (a bit of a verbose way to say: the other player goes next). The calculation only needs to happen once at the very start of the game. You can simplify your code a little bit.

From Adobe documentation, Math.random() is defined as:

Returns a pseudo-random number n, where 0 <= n < 1.

So somewhere between 0 and 0.99999r (but not quite 1). You're doing arbitrary manipulations to this number, you can do exactly what you're doing without multiplying it or ceiling it:

var r:Number = Math.random();
if(r < 0.5)
{
    // 50% chance this happens
}
else
{
    // 50% chance this happens, instead
}

It should be obvious that it's not actually 50:50 (refer to the documentation 0 <= n < 1), but it's close enough for your application. Your final code that only needs to be run once (as every turn after that just alternates between each player) might look something like this:

var r:Number = Math.random();
if(r < 0.5)
{
    // Your function might be something like this:
    showButtons("player1");

    // or maybe
    // showPlayer1Buttons();
}
else
{
    // The function call to let player 2 do his actions
}
Response to: The Flash 'Reg' Lounge Posted December 25th, 2013 in Game Development

At 12/25/13 06:34 AM, Sam wrote: Merry Christmas reg lounge, have a good one and don't get to drunk.

*too

Apparently I've had one too many.

Response to: The Flash 'Reg' Lounge Posted December 25th, 2013 in Game Development

Merry Christmas reg lounge, have a good one and don't get to drunk.

Response to: The Flash 'Reg' Lounge Posted December 24th, 2013 in Game Development

At 12/23/13 09:59 PM, egg82 wrote: Don't be that guy >:(

It actually worked on me once, I had to concede because I had to go somewhere. If he'd ended his turns I would have beaten him in time :(

I just had two brilliant games though. The second one was great, you know what you both seem to draw the right cards at the right time and it's always a back and forth without one being on the back foot?

Spoiler: I won.
Response to: A flash player player? Posted December 21st, 2013 in Programming

I've only just realised this is in the programming forum. This should be in the Flash forum. You're welcome to repost there.

Response to: A flash player player? Posted December 21st, 2013 in Programming

At 12/21/13 08:38 AM, Conal wrote: Let's say we have a SWF file that's over 20MB. Can we upload to Newgrounds a smaller SWF file that will load the bytes externally to make a heavy flash movie play? The source that the bytes come from could be Dumping Grounds.

Also, can we have 320kbps audio by streaming sound effects from an external source as well? So they play on the right frame and work like flash embedded audio?

If your sources stay alive then sure. I'm unsure if Tom will allow you to load from the dump though, my initial thoughts that things hosted on the dump are on a server that expects less load than the one that hosts stuff in the portal.

It might be worth hosting it yourself. That way you can make changes to the game by uploading to the same path which is something you can't do if you were to use the dump.

Response to: Android needs AIR Posted December 21st, 2013 in Game Development

As far as I know, you can't package AIR with your APK. The user has to have AIR installed in order to run your application. There are a handful of ways to go about developing an Android application now, but if you're already familiar with AS3, I'd urge you to take a look at haXe with openFL. I haven't created anything substantial but I've played around with it and development is a breeze coming from an AS3 background.

Response to: addChild Position Player exactly?? Posted December 21st, 2013 in Game Development

I haven't got time to go through and debug your code and stuff. But on a quick glance, and based on what your problem is, one of these conditions is being met:

if (player.x - playerHalfWidth < leftInnerBoundary)
			{
				player.x = leftInnerBoundary + playerHalfWidth;
				rightInnerBoundary = (stage.stageWidth / 2) + (stage.stageWidth / 4);
				levelOne.background.x -= vx;
			}
			else if (player.x + playerHalfWidth > rightInnerBoundary)
			{
				player.x = rightInnerBoundary - playerHalfWidth;
				leftInnerBoundary = (stage.stageWidth / 2) - (stage.stageWidth / 4);
				levelOne.background.x -= vx;
			}
			if (player.y - playerHalfHeight < topInnerBoundary)
			{
				player.y = topInnerBoundary + playerHalfHeight;
				bottomInnerBoundary = ( stage.stageHeight / 2) + (stage.stageHeight / 4);
				levelOne.background.y -= vy;
			}
			else if (player.y + playerHalfHeight > bottomInnerBoundary)
			{
				player.y = bottomInnerBoundary - playerHalfHeight;
				topInnerBoundary = (stage.stageHeight / 2) - (stage.stageHeight / 4);
				levelOne.background.y -= vy;
			}

As this is the only place you ever set the players x and y properties.

Parallax scrolling or just level scrolling in general, you should have a main container that holds everything (sorry if this is not much help and you already know most of it anyway). The player never leaves the stage, it's an illusion that it's moving around the level. Set the bounds for the player, and allow the player to move within the bounds. If the player leaves the bounds, the level should move instead. Because of this, the parent of the player should always be at 0,0 (for simplicity's sake) and never move. In your example you add the player to the level and also move the level. The player should move independently of the level. The level assets should then be added to the main container (I usually also have another container to hold all the level assets).

In the end it's something like this:

for each(asset in levelAssets)
{
    levelContainer.addChild(asset); //You might not do it this way, just demonstrating the levelContainer has all the assets in
}

mainContainer.addChild(levelContainer);
mainContainer.addChild(player);

// Your loop or whatever
if(player is within its bounds)
{
    // player reacts to input
}
else
{
   // levelContainer reacts to input instead
}

Sorry for being vague. I'll check back in on this thread later when I've got a bit more time. Good luck!

Response to: The Flash 'Reg' Lounge Posted December 20th, 2013 in Game Development

At 12/19/13 03:01 PM, Rustygames wrote: No one has mentioned the atrocious way Americans pronounce aluminium

This right here.

I could care less.
Response to: The Flash 'Reg' Lounge Posted December 18th, 2013 in Game Development

At 12/18/13 12:04 PM, egg82 wrote: I'm also working on capitalizing words like "I'm" and "I'd" because apparently they're supposed to be capitalized. Never heard that rule before, and I lived with some pretty big grammar freaks O.o

AMERICANS.

Response to: Class variable AS3 problem Posted December 18th, 2013 in Game Development

At 12/17/13 11:02 PM, Raghoul wrote: Line 9, Column 18 1084: Syntax error: expecting identifier before var.
Line 9, Column 26 1084: Syntax error: expecting rightparen before colon.
Line 9, Column 34 1084: Syntax error: expecting rightbrace before rightparen.

By the look of it you need to take a step back and learn correct syntax before attempting anything. There are various basic syntax errors wrong with your classes.

Response to: The Flash 'Reg' Lounge Posted December 15th, 2013 in Game Development

At 12/14/13 04:53 PM, MSGhero wrote: 1) No clue how to deal with asset sizes and screen sizes.

Screen size isn't too much of a pain. You can scale your main container to fit the screen completely (both in the X and Y), but if the aspect ratios are different, it'll distort. As a second option, you can pick the smallest scale factor between the X and Y and do both by that factor and then center the container on the screen. You'd be left with ugly black borders either on the top and bottom or left and right, so you could put some graphics over the top to fill the space.

I'm still unsure about assets, I haven't seen how shitty they can get if you resize them. I remember before when I used it back when it was NME with something that allowed me to grab assets from SWFs, it would do all resizing as vectors and then draw them as bitmaps which was quite handy, so nothing ever looked low quality.

It was a really hacky way to get assets though.
Response to: As3 - Getting Random Item Script Posted December 15th, 2013 in Game Development

var rand:Number = Math.random();

if(rand >= 0.99)
{
    // grand prize
}
else if(rand >= 0.9)
{
    // second prize
}
else if(rand >= 0.7)
{
    // third prize
}
else
{
    // consolation prize
}

You don't need to execute this with an enter frame listener, only when you want the prize picking to occur (e.g. on clicking a button).

Response to: The DotA 2 Alliance Posted December 14th, 2013 in Clubs & Crews

At 12/14/13 06:05 PM, Gobblemeister wrote: Legion Commander's one skill is pretty good for the wraith king thing too when the waves get really clogged. I don't like Drow, people always pick her but she doesn't really seem to accomplish much. I don't really know what items I should be getting for Wraith King so I usually just try to get armor and lifesteal but I don't even know if either really works.

Drows pretty much a one target hero. I haven't played with one yet so I don't know how fast she downs the waves. I've played mainly with Omni, Axe, Sven and Magnus. Haven't got passed the mini-rosh yet though :( I've only played a couple of games though.

Response to: The Flash 'Reg' Lounge Posted December 11th, 2013 in Game Development

Last.fm and foobar2000.

What is streaming??
Response to: [AS3] Preloader Posted December 11th, 2013 in Game Development

At 12/11/13 11:09 AM, MSGhero wrote:
Yes, I've already pressed 'play' button on the log window.
I don't know what that means. What log window? That's probably the problem.

In FlashDevelop sometimes my traces just don't show and I have to press play in the log window :(

Response to: Game translation? Posted December 11th, 2013 in Game Development

Sure, English is extremely widespread but I think this is an interesting proposal. Not everybody understands English, and Spanish is spoken more widely as a first language than English is.

I can see a few things happening if somebody lands at your game:

1) They understand English as a second language and don't mind playing the game in it.
2) They don't understand English, but attempt to play the game anyway
3) They understand English (not as a first language), but would much prefer to play in their native language or in one they are more familiar with, and leave your game
4) They understand no English at all. But perhaps another language as a second or first (odds being Spanish or Mandarin).

1 is a win for you, 2 is partial because if your game is complicated, it may be difficult to pick up without being able to read instructions. 3 and 4 are lost plays and views but if you offered a translation, perhaps that is a language they do understand - or understand enough to play (Nordic languages come to mind here, afaik Norwegians are pretty good at understanding both Swedish and Danish).

By having multiple languages offered in your game, you do nothing but increase exposure. I don't think it would do anything but improve your views and traffic. In all fairness, script translations are pretty cheap as it goes and if the money spent gives you ad views and clicks as a return then you're golden.

Response to: The DotA 2 Alliance Posted December 10th, 2013 in Clubs & Crews

At 12/10/13 02:59 AM, Gobblemeister wrote: Post your best game

Or don't, if you're terrible

Post match ID pls

Response to: I Need Programmers For A Game! Posted December 8th, 2013 in Programming

At 12/8/13 07:59 PM, MiniShowsDOTNetwork wrote: Dude... Its a flash game. it takes about 10 minutes to put all the codes in. (ive done this before)

If that's the case, why haven't you done it yourself yet?

and they do get credit. (in game and in the newgrounds game credit box thing) and plus. i already have all the parts where i want them, and i made the buttons.

While I highly doubt anyone wants to work on a very simple drag and drop game, this should be in the Flash forum. In all honestly, you'll be better off learning how to do it yourself. The project has no appealing factors from the standpoint of a programmer who will have to devote time to it and not to their own projects.

Good luck.

Response to: The DotA 2 Alliance Posted December 8th, 2013 in Clubs & Crews

At 12/8/13 12:58 AM, Ocelot wrote: I hope DOTA2 soon surpasses League of Legends in popularity. It deserves it.

I know a lot of League players. So many of them have said "Too many heroes are OP" or "Everyone is OP". But in all honesty, I think they've either played a handful of games or know someone who has and been completely pubstomped by an Ursa or Alch.

Do you guys think anyone is actually OP? Or is it inexperienced players not knowing how to deal with certain heroes? Sure Ursa hits like a fucking truck if he has the farm, but you can run rings around him if you have any sort of slow. If your team drafted cleverly then most heroes can be dealt with.

Also, when people say "Everyone is OP". If that was the case then the game would be equal and fair and no one would be overpowered, because it's all relational. SILLY.

At 12/8/13 02:32 AM, Yoshiii343 wrote: ...uh, hi guys. Got any tips on how to not be shit?

Aside from reading the links in my original post? Keep playing. You'll get killed and lose your lane and be hit with spells that you didn't even realise existed and get ganked by people and be told your warding sucks and have your K/D/A quoted to you by your team mates along with insults over mic and text in languages you don't understand. Gotta keep playing!

If you want to become good and not just "OK", watch some videos as well. DotA Cinema do a pretty good series on learning mechanics and goes into quite a bit of detail, perhaps more than you need to know to play casually. I don't know your skill level but "Purge Plays ...." are also ok. I don't like some of his play styles but they're good to watch if you have free time.

Response to: ColorTransform Posted December 7th, 2013 in Game Development

Additionally you could just compact it into a single line by using the ColorTransform constructor, if you want:

transform.colorTransform = new ColorTransform(1, 1, 1, 1, 255, 255, 255, 255);