00:00
00:00
Newgrounds Background Image Theme

Someone gifted MetalSlayer69 supporter status!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!
Response to: Best of January 2023! Posted March 27th, 2023 in NG News

Wow! Didn't even realise Flanders Killer won an award until I saw my PayPal last night! Thank you so much! Glad original pieces got more money! It almost doesn't feel right getting money for something not original! Glad everyone loves the series!!

Response to: AS2 param scene names? Posted December 6th, 2022 in Game Development

At 12/4/22 04:42 PM, Gimmick wrote: Yes, the scene name can only be a string. What are you trying to accomplish?


I'm getting js to talk to as2, and I'd like to parse what scene to go to that is dictated by the js, so ideally, I'd give it a variable that is of a string.


So

var myString = "myScene";

gotoScene(myString, 1);

instead of

gotoString("myScene");
AS2 param scene names? Posted December 4th, 2022 in Game Development

Is it not possible to pass params into the Scene name?

I always get "Scene name must be quoted string"


A guy on Discord helped, he said I was running my function before it was made in the ActionScript. It works once I put it in a timeout. I'm going to send data from the Flash to the JS to tell my JS the Flash is ready


At 9/4/22 12:52 AM, Gimmick wrote:
At 9/3/22 05:25 PM, Aprime wrote: Can I pick your brains @Mike ?
You might have better luck asking in the Ruffle discord directly since there's other developers who are also working on it there.

Thanks!!


Can I pick your brains @Mike ?


I'm using flash.external.ExternalInterface to make calls via ExternalInterface.call from my AS than my JS reads. This works perfectly through Ruffle.


To communicate the other way, instead of using ExternalInterface.call, I'm using ExternalInterface.addCallback. I believe I've set this up correctly on the SWF side of things, but via ruffle, calling this callback is may not be possible?


Typically via the JS, I'd do element.asFunctionName(param);


The element would be the swf, but in my case now, it's the ruffle element. I get a complaint in Firefox saying -

player.receiveText is not a function

Is there a way to get this to work in Ruffle?

Response to: Ask and i'll animate Posted January 14th, 2022 in Animation

Draw Tom Fulp shooting covid with a gun and then covid dies

Found a new bug Posted January 8th, 2022 in Where is / How to / Help!

So, if you view a medal from a users profile and then click view all, changing the sort filter will position the background of the site above the popup. As seen in the video here: https://i.gyazo.com/b9dabe1b2faebe72d96ad1d2c689d1e7.mp4


Uh oh, it's that time of the year when I've made a silly mistake and am trying to get a game out before the end of the year.


I've been using the same javascript code for newgrounds medal each year (api wise and my own references to it)


This year, to learn ReactJs. I had the bright idea to make a game in React.


Long story short, ReactJs doesn't like Minified code, so I've put the Newgrounds stuff in the Public folder and am referencing to it using window.


All the medals get retrieved, but the user doesn't get logged in and thus no medals get unlocked.


Any ideas what would be stopping this from happening?


I don't think it's the window stuff, because the logining happens in the head before the window variable is even set.


The games only in preview at the moment and thus unpubished - is that the reason?

Response to: Newgrounds.io Help & Support Posted December 10th, 2021 in Game Development

Have we got a problem now because of that Capcha?


https://newgrounds.io/gateway_v3.php


iu_493984_1308849.png


Anyone get Newgroundsio to work with React?

I'm getting errors like

Uncaught SyntaxError: expected expression, got '<'

Trying to find a song like this

https://www.youtube.com/watch?v=zFuFwZISZ6g


In the Newgrounds Audio portal, even better if it loops and can be used in games :D

Response to: Getting the url params of outside iframe Posted July 3rd, 2021 in Game Development

Wow! Great idea! Thank you so much!! I definitely wouldn't have thought of that!


At 7/2/21 10:40 AM, 3p0ch wrote: I suspect you're right and it's not possible, I get cross origin request blocks if I try to do anything along those lines.

I'm guessing the game's being run from a server since multiple players would playing directly with each other -- maybe take another approach (if you can do this from the server) of having player A invite player B (will need to know their NG user name), player B gets a link to the game's regular page without a query string, the server checks the user name (via the API) of anyone who joins, and if player A's invite to player B is still active and player B logs in it gives them an option of joining player A's game? The drawback is that players would have to have NG accounts (at least the invite-ee).



Ahoy,


I'd like to get the params of the newgrounds website from a game that's in an iframe on Newgrounds.


I'm creating an invite system that allows the player to share a url with their friends to play them.


We can do stuff like

let searchParams = new URLSearchParams(window.location.search)
param = searchParams.get('invite')

However, to get the url of the parent we can do

var url = document.referrer

or

var url = (parent !== window) ? document.referrer : document.location;

is there a way I can do this but obtain the actual params?

I'm thinking the answers no, because newgrounds hosts the games on a subdomain and there's the crossorigin request stuff that'll get in the way.


But heyho, just trying my luck, is it possible?


Cheers


UPDATE: maybe there's a way via the API?

NEW NEWGROUNDS BUG Posted April 22nd, 2021 in Where is / How to / Help!

Yeah, just go on a game - let's use mine as an example - and check out the highscores, press the drop down to acccess another highscore and poof, you'll be taken to a page with just an ad on it.

Response to: Best of January 2021! Posted February 7th, 2021 in NG News

Holy Moly


Response to: Games not loading Posted January 24th, 2021 in Where is / How to / Help!

Thanks!! That's great to know. I never tested on Brave or Chrome Incognito :)


Preloading audio before played JS Posted December 13th, 2020 in Game Development

I'm setting up my audio in js with this


 var soundsLibrary = {
        countdown: new Audio('audio/countdown.mp3')
    };

And playing it like so


soundsLibrary.countdown.play();

How can I preload it so that it is already loaded before the first time that it is called?

Response to: Distribute Your Own Games? Posted November 24th, 2020 in Game Development

How can you sell a game without traffic?


I'm trying to create a bat file, which loops through all the folders, goes inside them and zips up the content naming the zip the folder name. Then if the folder is named shared, it gives the folder a new name - in this case %var1%. Then it takes the zip out, back into tthe root where the batch was run.


I'm doing this on the fly, so far I've got the following


set /p Var1="Shared Folder Name: "

IF /i "%Var1%"=="" goto emptyFilename

echo "custom file name".
goto commonexit

:emptyFilename
echo default file name
goto commonexit

:commonexit
for /d %%a in (*) do (echo %PATH%)
PAUSE

I've got something like this

if (arrayOfEnemyDecision[0] != arrayOfEnemyDecision[1] != arrayOfEnemyDecision[2] != arrayOfEnemyDecision[3]) {
  console.log("passed");
}

But of course, that doesn't work, what's the best way? Or what are my options?


Hey,


I'd like to open a new tab/window for a pdf download for internet explorer. In theory, it doesn't have to be a new tab if it just downloads. My file link is inside an iframe, so it makes the task extra hard.


Please let me know.


Cheers,

Audio not playing Posted July 16th, 2020 in Game Development

I know you have to interact with the element, before it can display sound.


I've set up a game with WASD keys and arrow keys.


When WASD is used, the browser counts that as interaction.

When arrow keys are used, the browser doesn't and the sound does not play


Is there a way to get arrow keys to count as interaction?


Cheers,

Response to: Changing param objects inside callback Posted July 10th, 2020 in Game Development

What if the object is anonmous and only defined as a param

function Power(data, cb) {
  this.data = data;
  this.element = data.element;
  this.cb = cb;
  cb();
}


var currentPowerUp = new Power({element: 'dog'}, function () {
      this.element = 'test';
});
console.log(currentPowerUp.element); //dog
currentPowerUp.element = "potato";
console.log(currentPowerUp.element); //potato


How would it be done then? or would it not be possible to do it inside a callback?

Response to: Changing param objects inside callback Posted July 9th, 2020 in Game Development

At 7/8/20 06:05 PM, BrentHeMan wrote: This works:


Thanks! Interesting stuff!


Is there a way to do this with ES5 too?



I've got a data object and callback as parameters to my function


var currentPowerUp = new Power(data, function() {
  data.element = $("<div class='power-block'></div>").appendTo("#container");
});

Of course, changing the data value, won't actually change the object inserted.


Is there a way to change this object in the callback function?

I know I can do it outside with


currentPowerUp.element = $("<div class='power-block'></div>").appendTo("#container");
Response to: AS2 Key press question Posted July 6th, 2020 in Programming

Try on release, instead of press


I'm using web.whatsapp.com


I've made it so that I can populate the message with the following:


document.querySelector("._2UL8j > div:nth-child(2)").innerHTML = "hello";

I can also click the send button using this


document.querySelector('._1JNuk').click();

However, whenever the text is added in via JS, the send button doesn't appear. The only time it displays the send button is when input is added manually from the keyboard.


There must be a way to emulate this via JS.


If anyone has WhatsApp, please log into the web version and see if you can find a way to prompt the send button to appear one populating the textfield with the above code.

Response to: js ajax retrieving php data Posted May 15th, 2020 in Game Development

At 5/15/20 04:20 AM, BrentHeMan wrote: For debugging I would use something as simple as error_log() in PHP. This will print debug messages to either the console or wherever you have it configured. You don't have to print this out in JSON.


Thanks! I didn't even know that was possible!

I've got an errorlog page on my cpanel but it says:

The system failed to open the file “/etc/apache2/logs/error_log” for reading because of an error: Permission denied


I tried looking for that path, but inside etc there isn't a folder called apache2, shall I make one?