Be a Supporter!
Response to: Fantasy type art thread Posted March 25th, 2010 in Art

Hey! I didn't know you were posting your art on here, looking great so far.

About the last piece you posted, I'm not so sure about the facial expression, but I understand that this can change in the game depending on what she's doing, aside from that I think her legs are too thin and small compared to the rest of her body and arms.

Looking forward to seeing more of your work =)

Response to: $$ Selling art-set for a game $$ Posted November 18th, 2009 in Game Development

They look pretty cool, I asked some other coders, but none said yes =/

Response to: Array hit test question. Posted May 5th, 2009 in Game Development

Try a "for" loop =)

x = array.length();
for (var i =0; i < x; i++)
{
     array[x].hitTest(/*whatever*/)
}

The code is not written correctly, it is just a template for you to use as reference.

Response to: AS3: Basic Platform Posted March 25th, 2009 in Game Development

To do multiple platforms, try creating an array containing the amount of platforms and adding a for loop.
You can make a check that automatically counts the number of platforms and adds them to the array, or you could just place them all in yourself.
I won't write any code because I'd like you to experiment and try and figure it out. I just gave the concept for you to work with. Enjoy~

Response to: checking closed browser php Posted February 21st, 2009 in Programming

Oh ok, thank you, so I'll just let the PHP compare the timestamps while he's not on the page, because PHP can do that while noone is running it.
Now, please no one answer this thread anymore, it seems that you are useless.
Everyone who's ACTUALLY helped before, thank you, I appreciate it.
I think newgrounds is way too immature, it's the reason why I stopped posting here before. So I'm going to go to the professional forums where I used to go, at least there people are more mature and work with me better.

Response to: checking closed browser php Posted February 21st, 2009 in Programming

Oh no, I think you misunderstood me.
Let's say you have userA as a friend, on your userpage you will see "userA [online]" if he is online and just "userA" if he is not online.
What I want is, if you are userA and you're online, and you close the browser, if you were logged in, then I want that "[online]" to dissapear next to your name on your friend's page. I don't want the browser to check if you're logged in or not, I want to check if you are on the site or not. You could be logged in, close the browser, then return after 10 minutes, you will still be logged in, but your friend will see, during those 10 minutes, that the "[online]" label next to your name on his profile was gone.
So, please do not call me a moron, it's just immature. So is "Silly".

Response to: checking closed browser php Posted February 21st, 2009 in Programming

At 2/21/09 06:14 PM, yhar wrote: Using a value based online/offline system is:
a) More work
b) Silly
c) Short sighted

Why on earth would you do a 1/0 based system? It's silly, timestamps are the way to go. Have a field in the database; "Last online" or page action, or whatever, have every page load when they're logged in trigger an update of the timestamp, then simply have a function for checking, the function:

function useronlinestatus{
$currenttime = date();
$lasttime = database query for timestamp fetching;
if($currenttime - $lasttime >= 60){
echo "User is offline";
}else{
echo "User is online";
}
}

Psuedo code, kind of, but that basically says "If the last time a user was active (Viewed a page whilst logged in) was greater than 60 seconds ago, then say that they're offline".

Why would you not do that, and then instead use on/off? Silly.

Well, see, this is PHP code. Now, the only way for PHP code to work, to my knowledge, was if someone is on that page containing the PHP. If I make it your way, and if a user Closes the browser, HOW will the PHP check if the current time is an hour over the timestamp of the user?
THIS is my issue, not HOW to do it. I've used your method for when a user IS on a page and is inactive for 1 hour, I mentioned it twice before on this thread.

Response to: checking closed browser php Posted February 21st, 2009 in Programming

Ok, well, I tried using onUnload and I've been having quite some issues.
I first id an onLoad with php that changes the online boolean to true and an onUnload with php that changes it to false. That didn't work, so I tried with javascript, also didn't work. I then did a separate php page called "unloaded.php" and that contains php that makes the online boolean false, as well as automatically close itself as a pop up. In the onUnload I wrote "open.window(link)" and it worked at first but then had a few problems, so I changed that to onbeforeunload and it also worked for a while bu then stopped working. I'm guessing it's because of pop-up blockers.
Is there a way to do this?
I'm trying to change my "online" boolean to false whenever the page is unloaded and change it to true whenever the page is loaded.

Response to: checking closed browser php Posted February 21st, 2009 in Programming

At 2/21/09 11:23 AM, littleMonsterGames wrote: onUnload does work when you close the browser. Also, I'd say timestamps are the way to go - that's how it's done on most sites.

Plus it has the benefit of marking them offline if they're really inactive for a while, like, say if they go to work for 8 hours and leave your site open.

Well, I said I already have a method to make users offline if they're inactive, but see, timestamps would mean I have to do it in php on a page, meaning if the page is closed, that php stops working, thus being the same issue I already have. I want something that doesn't need the browser to be open constantly. And I think onUnload is what I was looking for, thanks guys!

checking closed browser php Posted February 21st, 2009 in Programming

Hi guys,
I seem to have a little problem with php. Here's the deal, whenever someone logs on, a field in the user database called "online" changes to "1" to display that this user is online on the site, and I made a code that checks if he has been inactive for 1 hour and logs him off if he has. That automatically changes the "1" back to "0", as well as if they press "logout". But if a user simply closes his browser while still logged in, the field remains "1" and doesn't change back to 0 until next time he returns to the site, so other users will think he is online while he's actually offline.
I'd like to make a check in php that, if the user leaves the page, closes the tab or browser, or anything of the sort, it changes that 1 to 0. Keep in mind I cannot use cron. Is there a way to do this?

Response to: php/mySQL: Check latest post Posted February 16th, 2009 in Programming

At 2/16/09 10:09 PM, ReFreezed wrote: SELECT `badge1` FROM `badges` WHERE `name` = 'The name'

This will get only the state of `badge1`. But I'm still not sure what you want to do. If you want to know exactly how the data returned from the database looks like you can use print_r($theData).

Ah no, I'm sorry for not explaining this right. What I wanted to do was check if the booleans are true or false, not check what booleans are associated with the name. =P
What you did was referring to the second format of the table, the one I wasn't using. But now I switched and I'm working my way around the problem. I think the original way I was doing this was very stupid. So I'm pretty much done with the questions.
Thank you all for your support guys =)
I appreciate it.

Response to: php/mySQL: Check latest post Posted February 16th, 2009 in Programming

I see. Thanks guys =)
Oh but I'd like to explain a little more about what I meant earlier. You see, my table kinda looks like that:
===============================
name | badge1 | badge2 | bagde 3 |
----------------------------------------
-------
Smith | ----0---- | -----0---- | -----0---- |
===============================

So I can't really make a check that checks each badge individually since the table isn't like:

=============================
name | badgename | true/false |
----------------------------------------
---
Smith | badge1 | ----0----- |
----------------------------------------
---
Smith | badge2 | ----1----- |
============================

I'm not sure if I'm explaining this right. But what I'm trying to say is, I usually check each row associated to the name to see if something is true or false, but in this case, the badges are all in the same row, so I'm not quite sure how to check that. But now that I think of it, I'll probably redo the table in the second format, but if it doesn't quite work, I'd like to know how I could make it work in the first format I have.
Thank you.

Response to: php/mySQL: Check latest post Posted February 16th, 2009 in Programming

Sorry for the double post, but by

sorry, you have no comments to display

I meant

sorry, you have no badges to display

So ignore that typo.

Response to: php/mySQL: Check latest post Posted February 16th, 2009 in Programming

Great! Thanks Ryoku, I should have thought of something like that. =P

Ok, new question:
I have an array filled with the booleans and I'd like to make a loop that checks if each is true or false. And if true, adds it to a new array.
I'm thinking something like

<?php
$username = $_GET['username'];
$checkbadges = mysql_query("SELECT * FROM badges WHERE user_id = '".$username."'");
$numRowsBadges = mysql_num_rows($checkbadges);
if($numRowsBadges != 0) //if there are badges.
{
	for($i = 1; $i <= $numRowsBadges; $i++)
	{
		$finalbadges = mysql_fetch_array($checkbadges);
                if (//check if badge(boolean) is true)
                {
		//add badge to array
                }
	}
}
else
{
	echo 'You have no comments to display.';
}

Not quite sure if I'm doing it right, and I don't know how to check if each boolean is true or not, since every badge has a different name.
if they had the same name I could have done:

if (badgename){
//add badge to array. Yeah, I'm not quite sure how to do that in PHP either.
}

I'd appreciate the help, thank you.

php/mySQL: Check latest post Posted February 16th, 2009 in Programming

Hey guys,
it's my first time posting in the programming forum. I've been working on my site and I'm not quite sure how to make PHP check the latest post a user does. I'm thinking of a way to check the latest timestamp or check the highest id in the array of all posts done by that user.
a little help please?
You don't need to spoon feed me how to do that, just point me the right direction. I know how to check the database for all the entries posted by the specific user and how to place them in the array. I just want to know how to only make the latest one, or the one with the highest post id, to show up.
Thanks =)

Response to: Which game should I finish? Posted February 14th, 2009 in Game Development

haha, it's funny how you though everyone would find the second one boring. =P
I vote the second one too!

Response to: Multiple Enemy Collision Detection Posted January 21st, 2009 in Game Development

::Bump.

Sorry for the double post... really need help with this one =(

Response to: Multiple Enemy Collision Detection Posted January 21st, 2009 in Game Development

heh, what are the odds.

And a side note: It's ActionScript 2.0

Response to: Multiple collision detection Posted January 21st, 2009 in Game Development

heh, what are the odds!

Well yeah for your problem I'd recommend doing your game with tiles and A* algorithm/pathfinding.

If not, then well, just wait for an answer on this or my post, we should be able to do this with a similar kind of coding.


Hey all!
I seem to be having a problem understanding how to make enemies all collide with each other to avoid making them move within/through each other.
This may seem like a newbie question but I'm not asking how collision detection works, I know all that and it's not the issue here. The enemies move in all directions but do not rotate.
The enemies in general use the name "Enemy"+i and I use it in a for loop on the enemy's AS sheet. Ex:
for (var i = 0; i < enemyNUM; i++){
_root.["Enemy"+i] do stuff
}

So to stop them from moving into each other, I've come up with something like this:

for (var i = 0; i < _root.enemyNUM; i++) {
if (_root["Enemy" + i] != this) {
if (this.hitTest(_root["Enemy" + i])) {
if (Up) {
this._y += speed * 2;
} else if (Down) {
this._y -= speed * 2;
} else if (Left) {
this._x += speed * 2;
} else if (Right) {
this._x -= speed * 2;
}
}
}
}

Which makes the enemy move in the opposite direction of whatever direction it's currently moving if it hits another enemy, but the problem is that what if it hits more than 1 enemy? it doesn't always mean the enemy it's hitting is in the direction it's heading. It's unstable and very unprofessional. So I'd like some advice, help, or a link to a good tutorial which explain how to do multiple collision detection without rotation and randomizing. As in, not like those balls that move around on screen and rotate and randomly change direction as it's hit by another ball.

Thank you =)

Response to: Need an Aartist for Completed Game Posted January 7th, 2009 in Game Development

I completely agree with coolio.
Me and the other members at madsoft share money from freelance work equally. Specially me and the team's lead artist!

Post an swf btw.

Response to: AS2 help. Posted November 20th, 2008 in Game Development

Modified it a little but still didn't work.
Any ideas how to combine hitTests and arrays guys? Maybe it's my original array that's messed, I dunno. I'd really want to try and figure this out.

Response to: AS2 help. Posted November 20th, 2008 in Game Development

Interesting... I'll try that and let you know.
Thanks~

Response to: AS2 help. Posted November 20th, 2008 in Game Development

ok then.
this creates my bullets and stores each name within an array:

if (Key.isDown(Key.SPACE)) {
if (timer>=5) {
_root.bulletR.duplicateMovieClip("bullet R"+i, i);
_root["bulletR"+i]._x = this._x+22;
_root["bulletR"+i]._y = this._y+17;
_root.ARRAY[_root.Ai] = "_root.bulletR"+i;
//_root["bulletR"+i]._visible = true;
_root.Ai++;
timer = 0;
i++;
trace(_root.ARRAY);
}
}
if (timer<5) {
timer++;
}
if (i == 100) {
_root.ARRAY = new Array();
i = 0;
_root.Ai = 0;
}

AND this creates my enemies:

if (timerx>=30) {
_root.enemy1.duplicateMovieClip("enemy"+
ix, ix);
_root["enemy"+ix]._x = 750;
_root["enemy"+ix]._y = Math.random()*300+25;
//_root["enemy"+ix]._visible = true;
timerx = 0;
ix++;
}
if (timerx<30) {
timerx++;
}

Now, I want a code that checks if any of the bullets stored within the ARRAY array is hitting one of the enemies. The code will be posted on the enemy itself.
I've tried a lot of different methods, couldn't quite get it right.

Response to: AS2 help. Posted November 20th, 2008 in Game Development

bump?

AS2 help. Posted November 20th, 2008 in Game Development

Hey everyone, I'm not sure how to explain this but I've done a code where the enemies are randomly generated and their instance names are all the same with a different number next to them (["enemy"+i]) where "i" is incremented everytime is created. I did the same for bullets. Now, I want to make it so that everytime a bullet (which could be bullet1, bullet2, bullet3, all the way up to bullet100) hits one of the enmies, the enemy dies. I'm thinking of including, on the enemy MC, a code that checks if the enemy is hitting an MC of the name bullet + any number between 0 and 100, I think arrays can achieve this, but I'm not sure how. Any help?

Response to: Need a Lil help:3 Posted November 17th, 2008 in Game Development

At 11/16/08 06:58 PM, KlyeXO wrote: dam, nvm its still doing it even after I break it.

lol, it's because you're putting several movie clips on a single layer on the main scene, everytime you tween something like that, flash automatically converts those movie clips into a single one and calls it "tween #", look for that in your library and you'll find it.
Try separating the movie clips into several layers, OR, just turn the whole thing into a movie clip and animate it from within the movie clip itself, but with several layers.

Response to: Disappearing movieclips? Posted November 15th, 2008 in Game Development

Do you have every movie clip on a different layer? You can't do any tween animations if you have more than 1 on each layer. Make sure to put them on different layers, then try again.

Response to: I want a drawing tablet. Help! Posted November 14th, 2008 in Game Development

At 11/13/08 06:27 AM, Munz wrote:
At 11/13/08 02:10 AM, Nuttro wrote: Ebay
No they will just rip you off and gove you a broken one

Wrong. I got mine for 5$ + Shpping. And it's brand new and works perfectly. I got lucky I guess.

Response to: Noob question about buttons Posted November 14th, 2008 in Game Development

Did you place the code ON the button?
Coz you can't place button codes on a frame. Post the error you get.
Also: make sure you put a stop(); on each frame.