Recent posts by zyxstand on Kongregate

Flag Post

Topic: Game Programming / managing menu screens

anyone?

 
Flag Post

Topic: Game Programming / managing menu screens

haha no, i mentioned oop earlier: i’m using as3

actually, i made a mistake – i also had a class named texture, so that was confusing things – i took it off.

now the error reads:
1120: Access of undefined property texture.

 
Flag Post

Topic: Game Programming / managing menu screens

again guys?

another quick question:

here’s my setup:
in cs4, i have a mc in the library (called ball), in that mc, i have another mc with instance name “texture”.
i have a ball.as file which extends MovieClip, and i can access the texture mc directly, but i get error:
1119: Access of possibly undefined property x through a reference with static type Class.
when i try to access “texture.x”

:(

 
Flag Post

Topic: Game Programming / managing menu screens

ahh another question:
how can i have a movieclip play inside a frame? that is to say, i want to create a rectangular border, and have a movieclip play in it, but only what is inside the frame. i know i could just fill the entire stage with a solid color and cut out part of it and have a movieclip play in a lower layer and only part of it will be shown, but that’s not what i mean.
so i could potentially import multiple swf files and play them side by side!

 
Flag Post

Topic: Game Programming / managing menu screens

great so we all agree!
i think the state class sounds best. also seems the most higher-level way of dealing with it – just what oop likes ;)

 
Flag Post

Topic: Game Programming / managing menu screens

hey i have a simple question as to how to approach managing multiple screens.
includes: splash screen, main menu, help screen, the game itself, lobby, map/level selection, etc.

I can think of 3 methods off the top of my head:
1.
make a movieclip for each one, create new instances of each in the code, put them on the stage and make them invisible, and have some manager change visibilities to show different menus.
2.
make a movieclip for each one, create new instances of each in the code, have a manager addChild and removeChild from the stage to switch between them.
3.
have a single movieclip and have each frame in the movieclip be a different screen, and simply change frames to show the different screens.

(obviously) the main concern here is memory usage and speed/efficiency. how much memory/processing do invisible movieclips use? is there a built-in feature in cs4 purposed to do something like this? what’s the most common approach?

 
Flag Post

Topic: Game Programming / programming questions

sorry for bump, but i didn’t want to start a new thread. check out my game thusfar on flashgamelicense.com. plz give feedback too. it’s currently strictly multiplayer, so if you wanna try it w/ me let me know what time ;)

 
Flag Post

Topic: Game Programming / Making Games With FlashDevelop

no
if you want to do games for kongregate (or any other gaming websites) it has to be flash (as3 or as2 – i’d recommend as3 (actionscript 3)) or javascript (but i wouldn’t worry about javascript as there are nearly no games in it). flashdevelop is a great, free editor for as3 and you can use it to help you compile as3 code (along with other libraries etc). if you are an absolute beginner in this (as that seems to be the case) google “hello world flashdevelop tutorial” and see where that leads you. they often have tutorials for complete beginners that guide you through installation of everything you’d need. Note that flashdevelop is not an editor for flash graphics – it’s merely the backbone for the code you write. it can, however, import/load/embed other files (like .swf files and flash symbols and stuff) so it is very powerful.
if you want the full quality environment you could purchase cs4 (or the newer cs5) from adobe – but it’s expensive and i doubt you’d wanna spend money at this point.
just google a lot of beginner tutorials. diligence is key!

 
Flag Post

Topic: Game Programming / Flashdevelop - AS3.

@simplegoogly:

you can incorporate external .swf’s into your project in flashdevelop.

also, flashdevelop is not just an editor – it is also a compiler! it can’t however (to my knowledge) compile .fla’s – for that, you need to compile it in something like flash cs4. also, (i think) you can’t edit timelines in flashdevelop – a feature that makes cs4 so much more powerful…

please correct me if i’m wrong about any of this :)

 
Flag Post

Topic: Game Programming / Flashdevelop - AS3.

flashdevelop will only help you write action script code – you’ll need something else if you wanna develop graphics. i use flashdevelop because it’s really good in the way a code editor should be – the most useful tools (to me) in flashdevelop: its autocomplete feature, its jump-to-definition shortcut (F4), its auto-import functionalities (or ctrl+shift+1), and the general ease of incorporating everything you need into one compiler, including library linking and easy to navigate interface.
but yeah, i use CS4 to actually compile (since i use custom classes generated in it) – i dunno a good free tool for you there…

 
Flag Post

Topic: Game Programming / Error 1046, with int

done that a number of times. fortunately flashdevelop’s markup makes it easy to tell when you’re doing something wrong syntactically. it’s funny that i’m now able to switch back and forth a lot between flash and c and use correct syntax in each…

 
Flag Post

Topic: General Gaming / have you tried...

have you tried this game called soldat?
been an fan of it for a long time – then became an off-again on-again player. it got quite addicting for me hehe…
it’s hard to get into at first, but tis much fun. oh, and it’s completely free! (pc only suckas)
site: www.soldat.pl
which is also my avatar*

 
Flag Post

Topic: Game Programming / Not even One programmer . . .

i’m working on a flash version of WoW – can someone write me a physics engine, network code, item manager, levelling, debugging?
so far i have:


play_button.addEventListener(MouseEvent.CLICK, begin)
public function begin(e:MouseEvent) {
// insert your code here!
}

thanks!

 
Flag Post

Topic: Game Programming / programming questions

hmm… what if it’s a strictly-multiplayer game? it would be hard for ppl to try it out cuz they’d need someone else to try it out too, and that’s unlikely during testing phase… how would i go about that?

 
Flag Post

Topic: Game Programming / need help with ramp physics

woah really? i’m glad it works.
Could you show me the result?!!

also i assume you understand that this array x position vector has to start at x=0. if you want it elsewhere you have to substitute x with (x – offset) wherever you see x (except of course at x += vx :P). and i suppose you should remove the enterFrame event listener in the else { } section… i’m sure you’ve figured that all out.

 
Flag Post

Topic: Game Programming / programming questions

5. OK, so my game has come a long way in a short time (mind you this is the first game i’m actually finishing and probs publishing). Where can I upload it to discuss it w/ other devs or ppl on the forums for bugs and ideas and general testing?

 
Flag Post

Topic: Game Programming / need help with ramp physics

i agree with creating a vector with y-coordinates (each element is the y coordinate of the next step)
to figure out how fast to make your guy move i can give you a formula i calculated:
vx = x-velocity
y = current y coordinate
g = fixed constant (gravity – figure out those units. i’m guessing a good start is around 2?)
dx = delta x = change in x = fixed value: the x-distance between each y-coordinate-element in your array (ie: 5)
yarray = array containing y-coordinates
dy = delta y = change in y = change in y since last frame (not like dx)
.
the code:
.


on(enterFrame) {
if (x / dx < yarray.length – 1) {
// change ^ 2 to actual function
cost = (yarray[int(x / dx) + 1] – yarray[int(x / dx)]) / ((yarray[int(x / dx) + 1] – yarray[int(x / dx)]) ^ 2 + dx ^ 2);
dy = vx * (yarray[int(x / dx) + 1] – yarray[int(x / dx)]) / dx;
// change sqrt to actual square-root function
vx += cost * sqrt(2 * g * (dy));
x += vx;
y = (x – int(x / dx)) * (yarray[int(x / dx) + 1] – yarray[int(x / dx)]) / dx;
} else {
// called when the skier is off ramp – set direction equal to slope between last 2 yarray coordinates
}
}

.
i recommend understanding the formula first. if you’re having trouble you can just ask me and i’ll show you the paper math work – it basically uses energy conservation calculations to figure out the new x-velocity. this might break down for very large vx (where vx > dx) or for jagged ramps.
also note: you must give your guy some initial velocity, or else he won’t move (due to the type of approximation used here :P)

 
Flag Post

Topic: Game Programming / [AS3] KeyCode 65 not working

yeah that tends to happen while debugging. shouldn’t this be something they fix in flash?

 
Flag Post

Topic: Game Programming / Depth Issue

if by “make health constantly available” you mean to always display it, then it should be pretty easy… can you give us some more info about your code in terms of where you display the health and what you observe that makes it not be available?

 
Flag Post

Topic: Game Programming / programming questions

thank you rameares.
the only thing i’m confused about is that i read that settextformat doesn’t change the default format, so my understanding was that any message appended should remain black (as is the default), but i guess that isn’t true?

oh, end it chould be “chatbox.length” instead of “chatbox.length – 1” – just in case you wanna know (end = first character not affected) – otherwise that last character in the message will remain green.

 
Flag Post

Topic: Game Programming / programming questions

thanks player_03
duly noted

 
Flag Post

Topic: Game Programming / programming questions

gotname is the function called by the addEventListener, so it needs the e:MouseEvent parameter. I wanted to reuse the function for when enterkey is pressed, but i need to pass a MouseEvent variable, so i just made up “blank”.
i probably should clarify that i’m not having problems with this code – i was just wondering if it’s bad practice to do so (or bad for other reasons)

 
Flag Post

Topic: Game Programming / programming questions

Hey guys,
I hope I’m allowed to do this: I wanna start a little on-going thread with some programming questions – i’ll cross them off as we go!

1. I’m not used to AS3-style oop in terms of class structure (like only one class per package etc.) – is it bad to create a class and essentially use it as the only instance by using static variables to practically everything?
.
2. RESOLVED I have a situation where you can click a button or press enter key (when focus is on a certain input textfield) – for the click i use a click event listener to function “onclick(e:MouseEvent)”. is it bad to call this function by creating an uninitialized MouseEvent variable and passing that? like this:

addEventListener(MouseEvent.CLICK, gotname);
// elsewhere:
var blank:MouseEvent;
if (keypressed == 13) gotname(blank);
//elsewhere:
static public function gotname(e:MouseEvent):void
{
// some code that doesn’t do anything with variable e
}

.
3. RESOLVED Is it possible to have differently colored text within a dynamic textfield?
.
4. RESOLVED This is really a followup on 3. I’m having some issues with some code – i want a chat window (dynamic textfield) to show all chat messages. each message is preceded by "somename: " – i want this "somename: " to be a green and the message black. the first message appears correctly, but every message thereafter is green.
// this function gets called every time a msg is received
var start:int = chatbox.length;
if (chatbox.text != "") chatbox.appendText(“\n”);
chatbox.appendText(player.name + ": ");
chatbox.setTextFormat(greenFormat, start, chatbox.length – 1);
chatbox.appendText(msg);

.
5. OK, so my game has come a long way in a short time (mind you this is the first game i’m actually finishing and probs publishing). Where can I upload it to discuss it w/ other devs or ppl on the forums for bugs and ideas and general testing?

 
Flag Post

Topic: Game Programming / How much do you earn?

Originally posted by UnknownGuardian:

None of those anywhere near. :D For a single game still at XX. Soon to be XXX for one of em though. (not released yet)

you’re making in the XXX for an unreleased game? nice! i wanna do that lol

do you suppose you could let us in on which games out there are making how much? would be nice to see the correlation between how good I think a game is and how much $$ it actually earns the developer… i suppose caesary is doing rather well, eh?
the games making good number of X’s – are they mostly (or maybe even entirely) by companies/large entity (rather than few devs/designers)?

 
Flag Post

Topic: Game Programming / Pathfinding. Worst case scenario?

i guess sc is tilebased (not a big fan of sc – don’t smite me) – path finding calculations are extremely low-cost resourcewise compared to all the other things going on in that game. i remember Age of Empires always had (relatively) crappy path finding – units would get stuck once in a while, and often not even take the fastest way. … the old days