# Recent posts by craksy on Kongregate

 i figured it out at last. i realized that C will always be 0 which makes this a lot easier. a = -(ty/tx^2) b = 2ty/tx ridiculously simple, considering the time i spent to figure this out . I’m trying to make a character jump in the path of a parabola. the player can adjust the top point using the arrow keys in order to aim his jump. i just need to know if my math is right here. i know this: tx = -b/2a ty = -D/4a x1 = (-b + sqr(D))/2a tx and ty being the coordinates of the top point, and x1 being the first solution (aka the point where the character will jump from). so now i got 3 equations with 3 unknown variables. basically i should be able to solve this, and get the values i need to draw the parabola… right? i hope you can help me out here guys ^^ edit. i just realized that finding D will do me nothing good. instead it should look like this i think: my question is the same however. can any of you math geniuses out there, tell me if my approach will work? Topic: Game Programming / Lights looking for something like this: http://www.youtube.com/watch?v=C-ScURIRTGA&feature=related ? seems like it’s build into box2d one more question though: When embedded this way, are they loaded along with the swf (instantly available for use), or would i have to make a loader for these symbols? Originally posted by NineFiveThree:Originally posted by DPbrad:When I have to do this, I usually embed the MovieClip like so; There’s actually no reason to do that, you can associate the embedded content directly with the class that has the embed tag, by placing the embed tag above the class block. this post solved my problem :) i just didn’t see it until after i replied. thanks a lot :) I haven’t worked with .SWCs before… using this method, how would i go about importing my assets, and still have a custom class for them? If i embed a movieclip using: ``` [Embed(source = "../lib/assets.swf", symbol = "Sword")] public static var weapon_sword:Class; ``` is it possible to make a custom class for the movieclip, as if i just exported it to actionscript in my document .fla? also, as wich class should i treat it? when adding this symbol, i simply use ``` addChild(new Assets.weapon_sword); ``` now, is it a Movieclip, or a spriteAsset or something else? Thanks in advance. Hi. Im working on a top down game, and I’m kinda lost on the collision detection. Basically i want a character to stop moving when he hits another character. This wouldn’t be any problem in a tilebased game, but i haven’t really done any collision detection on complex shapes before. Another thing is, the character shouldn’t be able to rotate through other characters or objects either. Are there any engines that you can recommend, or can you point me to an article from where i can learn about this? in advance: Thanks :) indeed i am looking at the contest d: Anyway thanks for the replies everyone :) i think im going to go with the wrapper :) Just wondering, how do you keep track of important objects across different classes? I’m currently playing a bit around with the playerIO framework, and i split it up into states like: LoginState, LobbyState, CreateRoomState etc. My main class is responsible for switching the states. the thing is i want certain objects (like the Client and Connection instances) to be available to all classes at all times. so far i have been doing something like this: ``` private var _client:Client = Main(parent).client ``` or at creation: ``` myState.setClient(client); ``` this however seems rather clumsy, as i have to do this for every class. so basically i want to know, how do you keep track of all your objects? there must be a cleaner approach? Originally posted by saybox: There’s a massive difference between correcting someone, and being rude to someone you think is asking a stupid question. A simple friendly correction doesn’t involve making fun of the user, calling them an idiot, giving them code that will crash Flash, or anything else along those lines. You do not understand what i mean then. I wouldn’t be rude to someone who asks a stupid question. As said, if the person puts just a little effort into it i will gladly help. even despite that he doesn’t get it, or must realize that it was too hard and doesn’t need help anyway. It’s okay. I would however be rude to a person who respond like the second example in senekis’ post which i was referring to. EDIT: removed Originally posted by saybox:They might come across as rude some of the time, but they’re generally trying to save face because you’ve made them feel like an idiot in front of everyone. They can’t be asking for help on a forum, and then not feel like being corrected. Who gives a flying fuck if they feel bad about receiving help? you hurt their self-esteem by giving them advice? “The world won’t care about your self-esteem. The world will expect you to accomplish something BEFORE you feel good about yourself.” – Bill Gates anyway, i don’t think you are getting senekis’ example.. imo. anyone who talks nicely or even just not-rude, and is actually willing to work for it deserves all patience and respect in the world no matter how dumb they may be. Anyone who is disrespectful to those trying to help them, or takes for granted the time and effort these people put into helping them deserve nothing. Why show respect to disrespectful people? being young is not an excuse. being unknowing is not an excuse. Heck, if your pet died and you are going to die of cancer tomorrow it’s still no excuse. perfect example. Sadly the second reply would have to be considered the most common around here. I forgive you.. people have called me things worse than crasky, or even cranky (you know, really mean things like “straight”) xD @saybox there is a huge difference from being unknowing and simply being an ignorant fool. as senekis93 said – some people just don’t deserve it. @RTL_Shadow i would consider your code spam.. make it an Event.ADDED_TO_STAGE instead so it’s only executed once :d @Senekis93 you have no idea how often people call me crasky instead of craksy. is my name that easy to misread? please please please sticky this! one thing though: where do we let our rage out if someone has clearly put zero effort into something and then post questions about it? sometimes lmgtfy just doesn’t cut it. i get nail marks in my palm everytime i see “tell how 2 mak game easy” or “Im making the new WoW, except you are going to make it for me” sometimes stupidity just has no excuse. What do you mean by dynamically attached, and externally loaded? as i see it, if you have to load something it’s external. please explain. so, short story: just don’t? Without having read all of this thread, i think i know what you mean by atmosphere boosters. If i understand you correctly, it’s the little pieces of discrete eye candy, that makes your game appear more aesthetic? heres a few: (not necessarily for your game) have your score text quickly become larger and then back to it’s original size, whenever you earn points. this will give the effect that the points is sort of bumping into the text. add a blur to the edge of the screen whenever you move real fast, or blur the entire screen whenever the game is paused. Use some sort of fancy transition when changing from one screen to another (like from menu to game). This can be sliding the new screen in on top of the other, or tweening the alpha of the current screen. Any little tween to ease the change from one scene to another. Small effects whenever anything is removed. This could be a coin you pick up. Give it a spin, a sound effect, and let it travel up to the text representing the amount of coins you have collected. Anything. Just don’t let it disappear out of nowhere. it will look odd. It can be anything. Just play a few games, and try to notice the small subtle effects that make it shine :) Hi, i just stumbled upon this while reading some articles about AS3 (it’s the description for an unload() function): “Unload everything that the garbage collector won’t unload itself, including graphics.” and i realized, i have absolutely no clue what the garbage collector takes care of, and what i need to remove myself. So, what would i remove in my unload() function? and how? Could you post me an example of an unload() function, so i can see what is removed, and how it’s done? thanks in advance :) One more question though. on a text field with multiline set to true, and autoSize set to center, how do i align all lines to the center? it seems all the lines are aligned to the left. It worked :D thanks a lot :) oh yeah of cause, to actually make up for the overlap, so that the two object will in fact never overlap. forgot about that i thought that tf.font = “fontname”; would do that? if not, what do i need to do? tbh. i didn’t bother to read through all that code but i think what qwerber means is: check if the hitboxes of two object collide. if so, use a more specific algorithm on those two objects to check if their pixels collide within the rectangular area between the corners of the two hitboxes. Hi kong. I’m trying to embed a font for my game over screen. I’m embedding like this: ``` [Embed(source=“Harabara.ttf”, fontName=“Harabara”, mimeType=“application/x-font”)] private var mahFont:Class; ``` and i apply it to my text field like this: ```var gameOverText:TextField = new TextField(); var tf:TextFormat = new TextFormat(); tf.font = "Harabara"; tf.size = 40; tf.color = 0xFFFFFF; with(gameOverText){ embedFonts = true; defaultTextFormat = tf; text = "Game Over"; autoSize = TextFieldAutoSize.CENTER; selectable = false; x = 100; } addChild(gameOverText); ``` However the textfield doesn’t show up. If i set embedFonts to false it does show, but of cause does not apply the font. It doesn’t seem to have any problems embedding the font file, so i think the problem might be with my textFormat object. any ideas as to what I’m doing wrong?