How can I fix lagg in Starling Arkanoid Game? - actionscript-3

I made a arkanoid game and sometimes the ball laggs is there a simple fix to this? Im not sure what code to post because I got a lot of code

There is a lot a reason for that... It's probably a framerate problem. You need to install or code a tool to check it.
If the framerate sometimes falls you need to inspect your main game loop and find the reason.
It's impossible to help you more with so few details.

To find the cause of an unknown performance issue, use the free Adobe Scout tool.
Once you get it running, you should see a spike in the graph it produces at the moment the game lags. Inspecting this spike should reveal the cause of the lag, whether it be garbage collection, a very intensive method, or something else.
Here's a 'getting started' link:
http://www.adobe.com/devnet/scout/articles/adobe-scout-getting-started.html

Related

Whats causing a very small leak after cleanUp in my AS3? Scout File Included

I have this FlashPro/AS3 project I'm working on, and thanks to the help of #vesper and others, I've managed to make significant headway.
At the moment though, there seems to be a slight leak in memory. A very small one at best. I've set up traces such as this one in a few places.
Trace:
trace("On Load" + System.totalMemory / 1024);
Locations:
On Load doCleanUp launchVideo
The leak is pretty small, and according to Scout, most likely related to something in the Uncategorized memory I think.
Here is the scout file - Scout File
Heres is the Full code
It would be awesome if I could get another pair of eyes on the output.
Test results show...
1) One video being clicked and left to play out
2) Two(2) videos played and stopped/dismissed
After quick look at Scout Session and comparing early frames with last ones it looks like it's using a bit more memory indeed. However... in "Current Total Memory" panel you can see it's in "Other -> Network Buffers" (at the end you have like 8,966 KB in there). So my guess is netStream is not being cleaned properly. After 1st one (at about 1:12) it's only 182 KB, but after second one (1:25) it's 7,320 KB.
Also - is there a reason why in doCleanup() function you're not calling vp.close(); ? According to DOCUMENTATION that should force stream to close.
Also 2 - Are you sure it's all garbage collected? You can try to call System.gc(); after cleaning. It's working perfectly in AIR, not as good in flash player, but worth giving a try. You can also force garbage collector in Scout. If you go to "Memory Allocations" tab (bottom part if you're using default layout) and there should be little bin icon. See if it does make any difference.

PlayerIO (AS3): How can I tell when a player has disconnected from the network?

I've got a real time game running using the PlayerIO framework. I can easily tell when someone has joined a Room, but I can't tell when someone has left (for example Alt-F4ing the program/browser).
I've considered disconnecting people that are lagging out, but this presents a new set of problems since I'm doing this mostly P2P.
you can know if a player is already disconnected by adding a function or a trace on connection.addMessagehandler("userleft" <-- smething lke that

Keyboard constant push not responding, possibly cause by lwjgl

Well, though this is a developers question and answer site, and i'm not, but i haven't found answer nowhere, i'll kindly ask to you for it..
I'm using a overhaul mod for minecraft and today i've bought a new keyboard, the fact is that i have to heavily push the button to advance or the space bar for example to keep registring their use, if i loosen the strength they stop registring, one of the developers of the mods hinted to me that the cause might be lwjgl since "thats what the library MC uses to do keyboard related checks" now i whish to know if there a possible way to solve this..
Ps i tried other applications, games, and writing.. I didn't have any problem anywhere else but in minecraft
Whoever told you LWJGL was at fault must be pretty inexperienced.
As both an LWJGL coder and also an experienced Minecraft plugin coder, I know that LWJGL cannot "not detect" keys if your computer thinks they are down.
Don't believe me? Read through this and you will see how it's impossible for keys to be "Not detected".
The issue will be either the computer, java, or the keyboard.
I think (and I believe others will agree) that with the information you have currently provided, LWJGL is in no way involved or at fault.

Reload a scene in as3

I made ​​a flash game with ActionScript 3. I want when the character falls into water or swamp
or his score=0, the game to be start from first.
I want load scene from first.
I am a beginner in as3. Please help me by details.
But I do not know what code to write.
I'm grateful for your advice.
I can only suggest grouping your level dependent variables and writing your own reset() method that is used to initialise and start the game. Then calling that whenever one of the loss conditions are met to restart the game.
As far as I know, this may not always be a quick and clean thing to do, nor do I know of any single "one size fits all" solution that won't causing any further problems down the line. This is more to do with how your design and layout your game code.

as3 listening to volume (db) at specific hz

I have looked everywhere, but I can't figure out how to do this.
I want to use a simple drum track, and everytime the kick drum goes off, something in my game should rotate.
Figured I could use the volume of that track at around 50hz or so to drive the angle of my object.
And thats where I got stuck, how do I read the volume at 50hz??
I really hope someone could help me with this!
Thanks!
Dennis
If this is still a relevant question, I would advise looking at Bit101's blog, where he posted a series of tutorials about producing sound. The second one is where he talks about producing specific sounds. (There is a "magic" formula that he uses at one point, described on this wikipedia page.) You can probably use this to backward compile the frequency from a given sound.