« first day (805 days earlier)      last day (4218 days later) » 
00:00 - 22:0022:00 - 00:00

12:01 AM
@TheBroodian yes~! it loaded, I'll try it now
@TheBroodian uhm... what is the accept key?
 
@Madcowe facepalm Haha, sorry, I forgot to delete my configuration before sending it to you. In the zip, in the content\Userprofiles\ folder, delete everything in that and restart the game
 
@TheBroodian oh lol, btw, love how you assign the keys
 
@Madcowe Ty ty, I spent a good amount of time making sure that it'd be relatively easy
@Madcowe Granted, most everything is still placeholder graphics
 
@TheBroodian no I meant the bar rising as you kept it pressed
 
I'm a huge fan of how Halo set up the invert-y setting. More games should do that for control configuration. :)
 
12:07 AM
@Madcowe Oh XD my bad
 
@TheBroodian either way, you weren't kidding when you said you made the graphics first, the game look really great
@TrevorPowell what did halo do exactly?
 
@Madcowe Thanks, but yeah, I've had to back off on the graphics as I add new things because they take way too long to make
 
@TheBroodian yea I'm sure... that's why I think my game will be "ready" and then I'll only tweek the graphics once in a while...
 
In the first one, they told you they were doing some sort of test, and told you to look up at the red light. Whichever way you pushed on the right analog stick, that way was treated as 'up'.
 
@TrevorPowell oh lol, that's awesome
know a game that, in my oppinion, was terribly coded and just awful to play in every aspect? (as well as kick my whole childhood and beyond right in the groin?)
 
12:10 AM
In Reach, they went even further; they had you sitting in a helicopter (with a view out the side), and a big explosion went off on the ground below you, visible out the door. Whichever way you pushed on the controller was then interpreted as 'down', on the assumption that people would immediately try to look to see what caused the explosion. :)
 
@TrevorPowell what about me :(
 
@TrevorPowell yea that's more subtle, even though that maybe not all would look... but most would though
 
@Gajoo No clue, really. It sounds like your trouble isn't related to enabling texture units. More likely to be vertex position/texture coordinate related.
 
@TrevorPowell have you seen previous screen shot?
 
@Madcowe: I like solutions which make things magically work for 60%+ of the population, without inconveniencing everyone else more than they otherwise would be. (everyone else just has to visit the options screen to configure their 'invert y' setting)
@Gajoo no
 
12:13 AM
@TrevorPowell yes, that would be the case, and quite clever too
also, has anyone played sonic the hedgehog for the ps3?
 
@Madcowe: (They skip the whole sequence in co-op, sadly. If you're playing multiplayer, you always have to do the invert-y setting manually)
 
27 mins ago, by Gajoo
user image
and the only difference is which texture is assigned to which sampler
 
@TrevorPowell well I never had an xbox so... but yea, I usually invert Y in all games
 
Are they supposed to be green and red?
 
vec4 mid = texture2D(u_texture,v_texCoord);
float g = texture2D(u_guide,v_guideCoord);
gl_FragColor = vec4(g , mid.g,0,1);
here is the shader code I'm using right now.
guide is single channel texture.
 
12:32 AM
some one please edit this question:
0
Q: Why circles are not created if small?

Suzan CiocI have changed the scale to my own and now I cant create any object, including circle, if it is of the size which is normal for my scale. I am to create big object first and then modify it to smaller size. Looks like minimal size protection is set somewhere. Where?

 
@Gajet Do you know how I can achieve smooth rotation in XNA? I've already got the body pointing towards the mouse, but I need it to do it "smoothly".
 
 
5 hours later…
5:25 AM
@CodeAssassin And here's Code Assassin never trying to figure things out!
 
 
2 hours later…
ufo
7:11 AM
Can someone help me?
1
Q: Why doesn't MoveBy work in this example?

ufoI'd like to run an action on a sprite using the MoveBy action. After lots of attempts, I can't achieve the goal... I have issues with the MoveBy in 2 different projects, so maybe I'm missing something in the setup... But I can't figure what! The instruction is like this: this.platform1Sprite.ru...

 
 
5 hours later…
12:38 PM
yay 70 rep :D
I mean 50
 
yay 2600 rep?
yay the strategy games I ordered arrived today, now I can lock myself in and do nothing productive for the next few weeks.
just hope my DVD drive survives this.
 
1:08 PM
people still have DVD drives these days?
 
1:22 PM
of course
lots of good stuff still released for those
 
hm
I don't have an optical drive at all.
 
especially for people with poor intenet connections and people having collections of DVD stuff
 
 
2 hours later…
3:24 PM
dammit I'm stuck again :/
how can I make a global class so I can change it for example on a shop menu?
I tried sharedObject.data... but am having trouble
on AS3.0
 
 
1 hour later…
user4704
4:26 PM
You mean a global instance?
 
user4704
Also, one should usually strive to minimize the number of globally-accessible things.
 
4:37 PM
so here's what I intend to do atm, have a button that when pressed would reduce my avatar (player) scale to 0.5
this would be done on the shopScreen
therefore on the shopScreen.as file
since the avatar is on the DocumentClass.as, I thought about using a sharedObject thaat would mean something like

avatar.scaleX = sharedObject.data.avatarSize;
avatar.scaleY = sharedObject.data.avatarSize;
and the button would, of course, when pressed

sharedObject.data.avatarSize *= 0.5;
for example... do you have a better idea?
 
user4704
If nothing else I'd pass the avatar that could be manipulated to the shop screen object instead of accessing it via a global.
 
hm... is that easy and quick to do or would I have to rewrite most code?
after loading the menu screen comes up, then when you press Play it calls the playScreen and unloads the menuScreen
the avatar and all is moved there
whhen it touches an enemy unloads the playScreen and loads the gameOverScreen
if you press the shop button there it unloads the gameOverScreen and loads the shopScreen
 
user4704
I can't answer that without seeing your code. Maybe. It should be easy.
 
and that's where I'm at
hm... but what part of the code? I have many .as files...
oh my bad, thhe key controls and avatar and such are on the AvoiderGame.as
where most of thee thingshappen
uhhm... dont know if this helps but, these are the imports on the AvoiderGame.as


package
{
import flash.display.MovieClip;
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.ui.Mouse;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;
import flash.events.Event;
import flash.media.SoundChannel;
import flash.net.SharedObject;

public class AvoiderGame extends MovieClip
{
public var army:Array;
public var enemy:Enemy;
public var avatar:Avatar;
public var gameTimer:Timer;
these are the document class

package
{
import flash.display.MovieClip;
import flash.ui.Mouse;
import flash.events.Event;
import flash.events.ProgressEvent;

public class DocumentClass extends MovieClip
{
public var menuScreen:MenuScreen;
public var playScreen:AvoiderGame;
public var gameOverScreen:GameOverScreen;
public var loadingProgress:LoadingProgress;
public var shopScreen:ShopScreen;
basically if I'm not mistaken, DocumentClass mostly checks to see what screen should be on, and the AvoiderGame is the mechanics and stuff of the gameplay...
gah I'm not even sure I have enough basics on as3.0 to do this yet...
 
Ugh
 
4:50 PM
also, with the code aas I had it (with the shared object and all) I would get the 1009 error which is that about the null reference
and sorry for flooding the chat
 
I wonder. @Petr Abdulin please do not copy wikipedia articles for filling tag wikis or tag wiki excerpts
Oh god, there are so many.
 
user4704
I don't think he's ever been in here.
 
user4704
But that's bad :|
 
Worth a shot
 
user4704
Can you rename tags? I think "gameloop" should be "game-loop"
 
4:54 PM
Yeah
 
can someone give me any ideas? I'm not really sure what to do
 
I wonder what is the best way to clean up these WP sourced tags.
 
user4704
Well, if you nuke the content entirely, somebody will presumably come along and edit them again... hopefully this time not sourcing from wikipedia. Are they easy to find?
 
Aside from seeing his activity, I can't tell. And I can only tell if they came from WP by looking at them each individually. Maybe the SO team can do a clear up like that. @GraceNote?
 
what's the issue with WP sourced tags? does it require attribution?
 
5:02 PM
Yeah, copying content from WP requires proper attribution.
All that's really required in there case is a link back to it. But I can't confirm that all of them have a link back.
 
So who is ready for a day off tomorrow? I sure am! :D
 
I wish :|. I've got to make up like days of work on a project that I am billed out to because IS needed extra time to confirm that I needed what I told them I needed.
 
That's irritating
 
Yeah, especially when the people I'm billed out to keep asking me what the status of it is every day.
 
5:21 PM
So I finished Dishonored this morning and I gotta say it was awesome. I like how some more modern games are using emotional ties to drive the player instead of just power fantasies.
 
I started, then I stopped and contemplated trying it without killing from the beginning. I'm only on the second chapter though
 
@ClassicThunder never really played it...
 
Some people just ask to be killed :\
2
 
@Noctrine and in the game
 
They kinda do. And some of the targets are big enough ass holes you really want to kill them. But I beat it without killing anyone. Think its more fun that way.
 
5:25 PM
I suppose that's the point though. It wouldn't be a challenge if not killing was easy :\
 
But mainly I just really like the story. I think it leverages gaming as a medium a lot better than most.
 
I think you missed part of the Url there
0
Q: Affect movieclip scale from a .as doc to another

MadcoweI've been working on a game following a tutorial on the internet, the game is an avoider where you have the Avatar, that has to avoid the objects that fall. The way it is made is: I have a DocumentClass which addChild's the screen you should be seeing and removeChild's the screen that you were. ...

 
oops
 
That one?
 
5:28 PM
yes
 
lol
 
Can anybody tell me- I have a solid red box being drawn in representation for a monster that I'm making, its bottom Y coordinate is at 607, which should be appropriate because the top of the surface its standing on is 608. For some reason when it's being drawn, there's a 1 pixel gap between the floor surface and the bottom of the monster's rectangle
 
well, have you tested it's Y coordinate to be 608?
 
its bottom Y coordinate is 607
 
5:32 PM
maybe it is because of the flash resolution
 
the top surface its standing on is 608
 
oh sorry, are you using flash?
 
no, but resolution could be a factor, I was just wondering that, but as far as I know, I'm not scaling anything
 
well but have you tried the monster's y pos to be 608?
 
I'm not following you
like, force it at 608?
 
5:34 PM
if you play a flash game on the internet, for example one that has many text boxes stacked, and then zoom out, you will notice that most have a 1 pixel game (which is normal) but the others have 2 black pixels of space instead of one
yes, make it's Y position 608 and see how it goes
 
if I force its coordinate to 608, my collision detection will pop it out of the tile it's intersecting
and it'll return to 607
 
and the gap will remain right?
 
yeah
 
can you send a screenshot or something?
 
5:37 PM
Wait there's a physics engine?
 
hm, maybe it's your collision detection
 
^^
make the image slightly larger than your cd rectangle
 
try to detect the collision 1 pix below
 
@ClassicThunder If all else fails, I'll definitely do this
Mostly I'm just curious if anybody could explain it, because it's being drawn as though the monster were 2 px away from its surface, but really, coordinate 607 is right next to 608
 
The physics engine is most likely pushing it too far when doing collision resolution.
I assume gravity is pulling it down?
And the physics engine is pushing it up a little above the ground.
Box2D does this too.
 
5:41 PM
gravity is pulling it down, yeah
I don't actually have a physics engine, it's my own precious crappily written code :D
 
Are you separating them until they are no longer touching?
 
it separates them until they are side by side
 
hm...
@TheBroodian I'll try to think of an explanation while i got get something, and btw, tell me when I can kill stuff in that game xD
 
it's a benign issue, my game runs right, and as Thunder said, I'll just make the image a little larger than the collision box if necessary, I was just curious
@Madcowe That's my next goal, I'll hit you up when it's fun
 
6:21 PM
@TheBroodian I'm back, so what happened?
 
@Madcowe Nothing atm, I chalked it up to strangeness with how it's being rendered. I moved on to getting the monster to do more than just sit there
 
@TheBroodian great, hope it works! I'm still stalled on my end
 
@Madcowe what're you stalled with?
 
0
Q: Affect movieclip scale from a .as doc to another

MadcoweI've been working on a game following a tutorial on the internet, the game is an avoider where you have the Avatar, that has to avoid the objects that fall. The way it is made is: I have a DocumentClass which addChild's the screen you should be seeing and removeChild's the screen that you were. ...

thiss
 
ahhh
hmm
yeah, I wish I knew more about AS3 to help
 
6:31 PM
@TheBroodian well can you tell mee on any other language so I can try to convert it?
 
well
like Benjamin Danger Johnson sort of said, it looks like sharedObject was never initialized
at least, in C# that's the first thing I would check
because that's what would cause it to be null
alternatively
I don't know if AS3 handles things separately like classes/structs
where things are handled as reference types vs value types
but yeah, it seems like you need to make sharedObject not null somehow
which means it isn't ever becoming any sort of value to begin with
 
yea but I did declare it, and then I made " sharedObject.data.avatarSize = 1;" before the code
 
if( sharedObject.data.avatarSize == null )
{
sharedObject.data.avatarSize = 1;
}
well that if statement you wrote looks to me like it wouldn't work either
because if sharedObject is null to begin with
then it won't store an avatarSize
 
hm I think I see your point
 
at least, that's what it would seem like to me
 
6:35 PM
I will try then, I just wonder this
ah nvm no I dont
 
that's my best ballpark guess, again, I don't know how similar AS3 and C# are
 
anyway, can someone check this code only to see if it's optimal? it's just a small question
I have a button to restart the game on both the gameOverScreen and the shopScreen
so I connected the restart function to both buttons
but it since the function first removed the gameOverScreen, now it can happen to the shopScreen to
so I did this:


if( gameOverScreen != null )
{
removeChild( gameOverScreen );
gameOverScreen = null;
}
else if( shopScreen != null )
{
removeChild( shopScreen );
shopScreen = null;
}
is that a good choice?
 
I see nothing wrong with that myself
afk for a bit, gonna go get lunch
 
hm well that didnt work, the if statement if it was null
... lemme try agai
 
odd
the title says "OpenGL4 reference pages"
but the content says 2.1
the actual content for OpenGL4 is at opengl.org/sdk/docs/man4
 
appears to be the same to me
man/man4, that is
 
oh, I have some caching issues then
frames are the devil
 
uhm can someone lend me a hand?
this code:

public function decreaseAvatarSize():void
{
sharedObject.data.avatarSize *= 0.5;
sharedObject.flush();
}
when I press the button that calls that function I get this error:
ArgumentError: Error #1063: Incompatibilidade de contagem do argumento ShopScreen/decreaseAvatarSize(). Esperado 0, obtido 1.
what's the problem with it?
 
Text Parser Error: Unknown language detected.
 
7:04 PM
I'll try and translate, incompatibility of counting of the argument ShopScreen/decreaseAvatarSize(). Expected 0, obtained 1.
 
then you call decreaseAvatarSize(foo) somewhere instead of decreaseAvatarSize()
 
hm...
lemme see
would you look at that it worked! :O
thanks Mr. :)
I just needed to put ( avatarSize )
yes! ^^ now lets continue with programming
@Mr.Beast thanks for the tip
 
High fives all around!
 
7:23 PM
Victory achieved!
 
Achievement Unlocked? :P
 
@ToddersLegrande lol no, I managed to program something I was having trouble with... and beaten all the achievement unlockeds xD
 
I need to either gain 2 or lose 3 rep.
someone help me!
 
@Gajoo what? why?
 
my rep is not currently division-able by 5!
 
7:31 PM
................
 
I know that feel, bro.
 
OCD much? :P
 
kinda
but it's not that much serious.
what should we do to bring down that ricket's announcement?
that's another case in my OCD :D
 
I don't think we can
 
@Mr.Beast is that your cat on your shoulder? are is that you on your human's shoulder?
 
7:34 PM
@Gajoo seems like it
 
yes.
 
I'm wondering, shouldn't "glBlendFunc(GL_ONE_MINUS_DST_ALPHA,GL_DST_ALPHA);" with near to far sorting result in the same image as glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);" with far to near sorting
 
Reverse Painter Algorithm?
 
something like that.
 
it's called Reverse Painter's Algorithm.
 
7:42 PM
please correct me if I'm wrong, if I want to reset variables and stuff stored on my HD and dont want to make a "sharedObject.clear();" function, should i simply delete the .sol file on the HD?
The painter's algorithm, also known as a priority fill, is one of the simplest solutions to the visibility problem in 3D computer graphics. When projecting a 3D scene onto a 2D plane, it is necessary at some point to decide which polygons are visible, and which are hidden. The name "painter's algorithm" refers to the technique employed by many painters of painting distant parts of a scene before parts which are nearer thereby covering some areas of distant parts. The painter's algorithm sorts all the polygons in a scene by their depth and then paints them in this order, farthest to closes...
hey nice, new information
 
8:04 PM
do you guys notice the difference between these two pictures?
if you look carefully you'll see there is a dark line around buildings in second picture.
and I'm wondering how to remove it.
the only difference between those two is image loaded as the back ground,
for the first one it's format is RGB while in the second one it also has an alpha channel.
 
is the alpha premultiplied
that would make the color darker
or is the alpha not premultiplied and filtering is making the color darker because the transparency is black?
 
@Jimmy any idea?
 
alpha channel looks good, must me something else
perfect
 
I've tried changing all my transparent pixels to white with alpha zero.
still they have blank shadow
 
so it's the other case. you're not using the right blendfunc
since your image seems to be already premultiplied
 
@Gajoo In the image you posted, there are still semi-transparent pixels
 
that can't be the problem
@JohnMcDonald semi transparent?
 
8:24 PM
yes, as in an alpha between 0 and 1
 
I know, but it should make things smoother, not add that shadow effect.
 
Well then, I think it's this premultiplied issue
XNA?
Loading from a stream?
 
tl;dr use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 
if XNA and loading from a stream/file, you can use this method to fix it. I think MindWorX wrote it:
private static void PreMultiplyAlphas(Texture2D ret)
{
    var data = new Byte4[ret.Width * ret.Height];
    ret.GetData(data);
    for (var i = 0; i < data.Length; i++)
    {
        var vec = data[i].ToVector4();
        var alpha = vec.W / 255.0f;
        var a = (Int32)(vec.W);
        var r = (Int32)(alpha * vec.X);
        var g = (Int32)(alpha * vec.Y);
        var b = (Int32)(alpha * vec.Z);
        data[i].PackedValue = (UInt32)((a << 24) + (b << 16) + (g << 8) + r);
    }
    ret.SetData(data);
 
@Jimmy I've already tried glBlendFunc(GL_ONE, GL_ZERO);
it's kinda more forceful compared to what they suggested with no luck
 
8:30 PM
back from lunch
 
I don't understand blend(1,0); doesn't that just not show bottom layer at all?
 
@Jimmy glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); seems to solve the problem
there is only one problem, I need to draw in reverse order
 
reverse order?
 
from near to back
 
The painter's algorithm, also known as a priority fill, is one of the simplest solutions to the visibility problem in 3D computer graphics. When projecting a 3D scene onto a 2D plane, it is necessary at some point to decide which polygons are visible, and which are hidden. The name "painter's algorithm" refers to the technique employed by many painters of painting distant parts of a scene before parts which are nearer thereby covering some areas of distant parts. The painter's algorithm sorts all the polygons in a scene by their depth and then paints them in this order, farthest to closes...
 
8:44 PM
I know about painters algorithm.
 
Hm. Misread what you said. :)
(It's early, and I haven't had my caffeine yet. ;) )
 
but in my special case I need to draw some of the images, and then draw other images behind it.
why it doesn't draw anything with "glBlendFunc(GL_ONE_MINUS_DST_ALPHA,GL_DST_ALPHA);"?
 
hiyo
 
some news, back buffer is not RGBA but only RGB :(
now it's fixed..
 
why draw in reverse order?
 
9:03 PM
I need to draw my character into the texture.
then create a somehow copy of that texture, finally draw background of that texture.
 
0.o
sounds like overcomplicating things but who knows...
 
@snake5 I'm provided with resources as in first texture
I need to add a glow effect as shown in second one.
I need to change image color range to match the third picture.
don't you think the problem itself is over complicated, even more than my solution?
 
no
 
then gimme a solution.
 
glow = draw those things to a separate buffer, blur, draw blurred buffer to main buffer, draw the things to main buffer
 
9:17 PM
that's why I'm drawing things in a separate buffer first.
and what about that color changing?
 
I don't see where drawing front-to-back comes in here
 
knowing that glow effect color should not be changed.
 
@Gajoo almost nothing, desaturate and multiply with some red color, perhaps add some pow() tweaks
@Gajoo ?
 
@snake5 it means you still don't see the problem
 
...
you gave the pictures, I see them
if I see them, I see the problem
but whatever, it's your time/money
 
9:19 PM
that white glow in the red image was just a show off.
 
overcomplicate things as much as you want :P
 
and besides, let's say I've drawn things into a separate shader and added the glow.
you are saying I should add another pass just to change color?
 
Passes are not that expensive
 
I'm already @40 fps.
 
it's either done in post-process (which is a very sane solution either way) or it's done in each object (which is a management hell)
 
9:21 PM
so I can't afford to lose even one fps.
 
0.o
and ... 40 fps? optimize something then :P
make it >80, there's nothing big to draw
 
I'm working on iPhone.
on PC, I'm running @700 fps
and my laptop isn't even near the tops.
 
iphone has one of the fastest mobile GPUs, if you can't optimize for that then uh...
 
it's only for optimization purpose that I need to reverse render.
draw a couple of stuff, create a copy, and then draw other stuff (back ground)
I can't afford to simply draw everything twice.
 
optimization? doesn't look like it
 
9:24 PM
the iPhone supports shaders?
 
@ClassicThunder yep, OpenGL ES2
 
anyway, g2g
 
bah, I need a good sit/stand desk for both home and work
 
@snake5 with my current solution (and couple of more stuff) I'm running @600 fps.
without that copy buffer trick I drop down to 500fps
and there are still lots of things to implement for drawing (other than background)
 
user4704
Stop using FPS as a metric.
 
9:27 PM
@JoshPetrie what else should I use?
render time?
 
user4704
Milliseconds per frame is vastly more useful.
 
sounds like the same metric
 
user4704
FPS is nonlinear.
 
user4704
500 FPS is 0.002 seconds per frame. 600 FPS is 0.0016666~ per frame. That's an exceedingly massive difference of 0.00033334 seconds.
 
user4704
Which is not nearly as drastic as "a 100 FPS drop" sounds.
 
9:30 PM
Kinda like MPG (miles per gallon) is bad, while Gallons / 100 miles is good
 
user4704
Furthermore, 400 FPS is 0.0025 seconds per frame, and the difference between 400 and 500 is 0.0005 seconds. (not 0.00036667, see?)
 
user4704
FPS is a sloppy optimization metric since it compares poorly due to its nonlinear nature.
 
@JoshPetrie I kinda compare two fps using (fps1 / fps2)
it still not the best but fixes that problem a little bit.
 
user4704
or you could just talk about sane values like normal people do
 
to be honest the only reason I used FPS is because that's how the engine reports.
@JoshPetrie sane values?
 
user4704
9:33 PM
@Gajoo such as milliseconds per frame, as I said. Just compute and express that, it's much easier to follow.
 
changed engine reporter.
now it's reporting as mspf (currently 1700)
and without that trick it's 2000.
@JoshPetrie I guess it's better now.
@JoshPetrie anyway, do you have any idea about my problem(s)
how to solve them or enhance my performance?
 
user4704
No, I wasn't reading them.
 
hey guys
can someone check this code only to see if it's optimal? it's just a small question
I have a button to restart the game on both the gameOverScreen and the shopScreen
so I connected the restart function to both buttons
but since the function first removed the gameOverScreen, now it can happen to the shopScreen too
so I did this:


if( gameOverScreen != null )
{
removeChild( gameOverScreen );
gameOverScreen = null;
}
else if( shopScreen != null )
{
removeChild( shopScreen );
shopScreen = null;
}
is that a good choice?
 
what about passing the sender to the restart function?
 
@Gajoo thought about it, but still a bit new to as3.0 to be sure on what to do
 
9:43 PM
@Madcowe I don't have any experience with that either.
just thought that could be another solution.
 
@Gajoo if you know C# you can tell me there, they are a bit similar and I have studied C# a bit
@Gajoo I was just wondering if there is anything wrong with making the code that way
 
@Madcowe I don't think it's wrong, but still I need to look at whole code to give an opinion.
 
@Gajoo alright, I'll post the relevant parts if you're interested
in the shopScreen.as I have this

public function onClickRestart (mouseEvent:MouseEvent):void
{
dispatchEvent( new NavigationEvent ( NavigationEvent.RESTART ) );
}
 
also I've learned almost everything by myself, so I can't tell if something is considered a good practice or not. I can only tell if I have a bad or good feeling about that
 
on navigation event thiss: public static const RESTART:String = "restart";
public function onRequestRestart( navigationEvent:NavigationEvent ):void
{
restartGame();
}
that on the Doccument class
and also on doc class:


public function restartGame():void
{

playScreen = new AvoiderGame();
playScreen.addEventListener( AvatarEvent.DEAD, onAvatarDeath, false, 0, true );
playScreen.x = 0;
playScreen.y = 0;
addChild( playScreen );
Mouse.hide();

if( gameOverScreen != null )
{
removeChild( gameOverScreen );
gameOverScreen = null;
}
else if( shopScreen != null )
{
removeChild( shopScreen );
shopScreen = null;
}


stage.focus = playScreen;
}
and that's it
 
9:56 PM
@Madcowe I can't figure out, where are onClickRestart and onRequest restart written?
 
the onClickRestart are located in the .as files connected to the gameOverScreen
and the other .as to the shopScreen
 
also I assume flash has a managed memory right?
 
and he rest on document class
@Gajoo what do you mean?
 
@Madcowe you don't have to delete things.
it has a garbage collector deleting everything you don't need.
 
@Gajoo well if it is what I think you mean, it does have a garbaage collector
thats what the , false, 0, true ); at the end of the function means
 
00:00 - 22:0022:00 - 00:00

« first day (805 days earlier)      last day (4218 days later) »