Recent posts by Darty on Kongregate

Flag Post

Topic: Game Programming / Finishing Touches

http://www.actionscript.org/resources/articles/965/1/Better-Flash-Navigation-using-AS3-Classes/Page1.html

This link provides a tutorial for creating a state manager, which will make it a lot easier for you to add a menu and preloader to your game

 
Flag Post

Topic: Collaborations / Stitch - Dark "puzzle" platformer

This seems quite similar to a game i worked on for a uni project(not saying you stole our idea or anything like that so don’t worry lol) so it should be interesting to see this developed into a full game and not just 1 level like we had hehe.

 
Flag Post

Topic: Game Programming / Classes

The firing problem is because you are defining your onMouseDown and onMouseUp functions inside a class that extends a movieclip. This means that those functions will only be triggered if the cursor is over the instance of the playerguy when the left mouse button is pressed. By moving those out of the class but having them call functions in the class you should solve the issue.

 
Flag Post

Topic: Game Programming / Flash [Help]

1. FlashDevelop
2. AS3
3. FlashDevelop is a free IDE which a lot of developers on here use, it doesn’t have the graphical interface that CS* has meaning you have to do everything through code.
4. AS3 is generally considered more efficient than AS2 and the skills you will learn while using AS3 will be easily transferable to other object oriented programming languages should you wish to expand your skillset in the future. However it can also be difficult to learn if you have never had any exposure to object oriented programming.

 
Flag Post

Topic: Game Programming / GiTD [#1] Entries and Discussion

sigh i always end up seeing these a day or 2 before the deadline. I wish Kong had a seperate forum section for things like this to make them easier to find lol

 
Flag Post

Topic: Game Programming / To Flash Developers:

A lot of newbie developers come to these forums asking for more in-depth/specific tutorials than the shootorials so it might be an idea to have a larger tutorial section. This would draw initial traffic to your site and also provide you with a lot more developers willing to upload their games to your site.

Another useful feature might be to expand on the collaboration concept allowing development teams to create their own group page(rather than creating a new user account which is what people tend to do at the moment) This would be a page where group members could chat privately but would also act as a “store front” to other site visitors providing links to all games developed by the team.

 
Flag Post

Topic: Game Programming / [AS2] Saving/Loading

basically the issue is caused by the shared objects for the two versions of your game being stored in different locations. Read this section of the wiki for more info about where the shared objects are stored:

http://en.wikipedia.org/wiki/Local_Shared_Object#File_locations

 
Flag Post

Topic: Game Programming / Warning to Devs...

one good way of site-locking your games without punishing the player is to:

1. limit the number of levels that can be played on sites you haven’t given permission to have your game.
2. provide a link in the main menu and when the level limit has been reached linking to the full version of your game on a site you have given permission to have your game.
3. display ads between levels on the sites you haven’t given permission to have your game.

This way the developer will get revenue from ads and sites like kongregate without the player feeling cheated and also the players will more than likely go straight to the site they could play the full version of the game when looking for other games to play.

 
Flag Post

Topic: Collaborations / Half Brain Prod.

Can’t believe this thread is still active lol and better yet there is still no gdd, I’ve been working in a team who had a professional gdd with marketing info and concept art of around 18 pages(for the first version) and that only took around 2 weeks to complete. I really feel sorry for these guys who are still giving pieboy more chances, because they are clearly enthusiastic about making a game. If it carries on like this though that will never happen.

 
Flag Post

Topic: Game Programming / Making Multiple Main Classes?

http://www.actionscript.org/resources/articles/965/1/Better-Flash-Navigation-using-AS3-Classes/Page1.html

This link should help. It uses a state machine like chocchapenda’s example but goes into more detail.

 
Flag Post

Topic: Game Programming / Using composition in classes (AS3)

hmmm, ok just to check 2 things:

1. you will also need to add:

this.addChild(ground);

to the Level_1 class(if you havent already.)

2. The while loop in the everyFrame function should now look like this:

    while (parent.ground.hitTestPoint(this.x, this.y + 63.5, true)) 
    {
        this.y--;
	grav = 0;
	jump = false;
    }
 
Flag Post

Topic: Game Programming / Using composition in classes (AS3)

to solve the input issue after calling:

player = new Player();

you need to add:

   this.addChild(player);

without calling the addChild function here the player never gets added to the stage, therefore there is never a ADDED_TO_STAGE event for the player and the addedHandler never gets called(so the keyboard event listeners never get created.)

the error you are getting about ground being undefined is because the ground object isn’t created in player. Without knowing exactly where you have created the ground object i can only guess that you have also created that in the Level_1 class, if this is the case you can access it through

parent.ground
 
Flag Post

Topic: Game Programming / Using composition in classes (AS3)

thats because you are trying to access a player object inside the player class you can replace all references to player inside the player class with “this” or remove them all together

 
Flag Post

Topic: Game Programming / Using composition in classes (AS3)

because player extends Level_1

player = new Player();

also calls Level_1’s constructor(which is where you are creating a new player) so the code just goes round in circles creating new levels and players.

 
Flag Post

Topic: Game Programming / [AS3] Inventory

Originally posted by watkins577:

Darty youve got the wrong concept it is 2

Ive even just run it

Edit:

Person deleted their post >.<

yup…thats why i deleted the post lol random moment of stupidity from me there lol, just out of interest though where did you get the term mod snap for “%”, i’ve never known any1 call it that….only mod/modulo

 
Flag Post

Topic: Game Programming / Door lock

== is used to compare the value on the left with the value on the right, = is used to assign the value on the right to the value on the left, thats why it is correctCodes = 0, also in as2 using “var” is not necessary.

ok for the if statement:

    if(myArray[correctCodes] == valueForThisButton)

in the first part of the if statement “myArray[correctCodes]” correctCodes, is used to get a value from a specific position in the array. These positions(or indexes) can be seen more clearly in the first method i showed for the array declaration(the numbers in the “[]” are the indexes).

so when the code guess mini game starts correctCodes = 0, so we compare the value of the button we have pressed with the the value at index “0” in the array….if they are the same we increase the correctCodes variable by 1(correctCodes++ does the same as correctCodes += 1)

so if we have guessed the first number correctly the new value of correctCodes will become 1. So the next button we press will compare its number with the value at index “1” etc until g is pressed.

“valueForThisButton” is not a variable that has been created anywhere so you will have to set this value yourself.

eg

    //this would go in the "5" buttons onRelease function
    if(myArray[correctCodes] == 5)
    {
        correctCodes++;
    }

It this does not help give me some more info about what the error is and i’ll try and give some more specific help.

 
Flag Post

Topic: Game Programming / Door lock

using arrays will be the best way of doing it.

how to declare arrays:

Method 1:

myArray = new Array();
myArray[0] = 5;
myArray[1] = 2;
myArray[2] = 3;
myArray[3] = 4;
myArray[4] = 1;

Method 2:

myArray = new Array(5, 2, 3, 4, 1);

An array is basically just a list of items grouped by a meaningful name so for yours you could call it something like keycode/keycodeArray/whatever.

then you can create another variable to store the number of correct codes entered:

    correctCodes = 0;

now in the onRelease functions for your number buttons you can add this:

    if(myArray[correctCodes] == valueForThisButton)
    {
        correctCodes++;
    }

finally in the “g” buttons onRelease function add this:

    if(correctCodes == myArray.length)
    {
        //do whatever happens when the correct sequence is entered here
    }
    else
    {
        correctCodes = 0;
        //do whatever happens if an incorrect sequence is entered here
    }
 
Flag Post

Topic: Collaborations / Looking for Artist and Programmer

Originally posted by Capucchi:

Always save GDDs as a text file. Not everybody wants the latest version of word.

you know people could always get openoffice(for free) which can open microsoft office documents…….just a thought. Also the idea of a GDD is for it to contain some concept art….correct me if im wrong but a txt file doesn’t allow pictures.

 
Flag Post

Topic: Game Programming / [As2] Help with save features.

You will need to look into shared objects. Here is the adobe doc on shared objects….The code is in AS2.

http://kb2.adobe.com/cps/161/tn_16194.html

 
Flag Post

Topic: Collaborations / I need short reviews of a tutorial

also the two issues i mentioned last time you posted this…..IE bullet fires in the wrong direction if the player doesn’t turn at the start of the game and bullet firing from the chest not the gun still haven’t been fixed in the swfcabin example you link to

 
Flag Post

Topic: Game Programming / Hitest goto nextframe

use

    _root.nextFrame();

in place of

    _root.gotoAndPlay(3);
 
Flag Post

Topic: Game Programming / Help with Mazes

Not sure if there is a better way but my first thought would be to make the maze and orb into bitmap data. Then use the GetPixels() function (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/BitmapData.html#getPixels%28%29) to get the area of the maze covered by the orb and also the orb itself. you can then loop through both arrays of pixels and if the maze pixel is the colour of the walls and the orb pixel is the colour of the orb you know the orb is hitting the wall. However this seems like it would be quite a lengthy calculation to do every frame for something that could be done much more efficiently.

 
Flag Post

Topic: Collaborations / I CAN WRITE FLASH CODE

The arrogant attitude you have is clearly going to be an issue for any1 you work with.

 
Flag Post

Topic: Game Programming / clean coding?

i think what you are asking for is a state manager. It would take too long for me to explain how to implement 1 of these in actionscript however here is a link to an example of a state manager written in C++. It shouldn’t be too difficult to transfer it to actionscript.

http://gamedevgeek.com/tutorials/managing-game-states-in-c/

 
Flag Post

Topic: Collaborations / Site for organizing collaborations?

Hmm yeh the only thing like this i can think of is dotProject(http://www.dotproject.net/index.php) you need your own hosting to use it though.