Recent posts by trashantboy on Kongregate

Flag Post

Topic: Rise of Champions / Bugs

Veteran Task 3 bug is still not completely fixed. The task is “Defeat Yog-Sotheth”, but it claims that the task is completed after defeating Golem. However, if you try to claim it at that point, it gets locked into “checking reward” forcing you to restart. The claim button should not trigger until Tog-Sotheth is defeated.

 
Flag Post

Topic: Game Programming / 2014 One Game a Month

I missed April (finals month is super busy for full-time tutors :D) but here is my game for May:

http://www.kongregate.com/games/trashantboy/platformerbeta

 
Flag Post

Topic: Game Programming / Selecting a target with a mouseEvent

The way I am currently doing this, which appears to be right based on what I can find online, is to have the parent actually call the attack. When the attacking character is chosen, rather than adding the event listeners to the chosen character, I add them to the parent. I also set a variable in the parent to reference the attacker (parent.attacker = this);

Then, when the listener fires with a mouse click, the parent calls attacker.launchAttack(e.target) before resetting attacker to null. This will allow the chosen character to fire at the chosen target. If anyone has a better way of doing this, let me know.

Of course, this still has its problems. Currently, the chosen attacker is hitting himself because the event listener to launch the attack is being added (and fired) before the event for selecting finalizes. However, since I know why this is happening I should be able to get around it.

 
Flag Post

Topic: Game Programming / Selecting a target with a mouseEvent

Because the attacking character can be any of several members of the team. The player will select that as well

 
Flag Post

Topic: Game Programming / Selecting a target with a mouseEvent

I’m working on a larger project, and I am running into a simple problem that is giving me far more trouble than it should. I want to be able to choose which character to use an attack on by clicking on the appropriate icon. There will be a large number of possible attacks/character types, so what I would like to do is be able to call the attack function like so:

typedAttack(Character)

where “typedAttack” is one of several different attack function within the character doing the attack, and Character is the target of the attack (which can be any Character, as Character would be a parent class).

However, I cannot figure out how to get the attacking character to listen to an event on another character. I would think that I should be able to use a MouseEventListener.Click and just make sure the target (not currentTarget) is a character which I can pass to the attack function, but since the event only captures and bubbles up to the stage and back in a line of direct ancestors, the attacking character can’t hear the event. I’ve been experimenting for a bit, and I’ve managed to make both attacker and attackee attack simultaneously, or to have the attacker only be able to attack himself.

It’s probably a simple solution that’s just staring at me, but how can I get this to work?

 
Flag Post

Topic: Game Programming / 2014 One Game a Month

March’s game. It’s a quick one. I’ve been working on a bigger game, but wanted to get one in for the month so I wrote it in 8 hours while driving across the country. (I was a passenger, obviously)

http://www.kongregate.com/games/trashantboy/mastermind

 
Flag Post

Topic: Game Programming / Using an icon set

I want to use some of the icons found here in my March game of the month game, but I’m not entirely certain how to go about doing so. I could probably just trim down the full set to get the one I want since modifications are allowed under the license, but if I wanted to use a sprite set for animation, for example, that clearly wouldn’t work.

Last I looked, I thought I understood the theory. You put the set on the field, then mask it with something else so that only the part you want showing shows up. If you want to animate something, you then move the back one so that different parts show in sequence.

Is that still considered best practice, or is there another way to do it in actionscript? If it is, can someone post some example code for the mask, because I’m not actually sure how to implement that so that it doesn’t interfere with whatever else is on screen (backgrounds, etc.). If it’s not, could someone point me in the right direction?

 
Flag Post

Topic: Game Programming / 2014 One Game a Month

I forgot to post this, but it was up by February: www.kongregate.com/games/trashantboy/evil-hangman

 
Flag Post

Topic: Game Design / Good tutorials for artwork?

So… I’ve never made any of my own art for a game. So far, I have used basic shapes created programatically to represent game elements for something like a concept test, or I have gotten open-source artwork that has a license I can use. I’m thinking about trying to do a little of my own artwork for a simple game I’m working on, but have NO idea how to go about it. Where can I find some good tutorials for creating digital art? What are some good software solutions for drawing game art? Where do I go to learn from the ground up?

 
Flag Post

Topic: Game Programming / Pros and Cons of subclassing

@Archiepl1: That’s basically what I did with the concept test I threw together to post here last month. I just made them all Sprites, not GameComponents, but the way I used them was basically the same. Is GameComponent an interface that you put together, or just the way you think about it, or what? I don’t see it in the trunk api, so that’s why I’m asking. Is there additional functionality above and beyond that available to a Sprite?

@Vesper: Hello! Thanks for the answer over there. I think between the two answers from you and Archie, I know how I’m going to make this work.

 
Flag Post

Topic: Game Programming / 2014 One Game a Month

I didn’t even know what 1GAM was until today. I’ll whip up a profile soon and link it for the OP. And since it doesn’t seem to have gotten including, this is my entry for January.

http://www.kongregate.com/games/trashantboy/concept-test-toy-soldier

 
Flag Post

Topic: Game Programming / GiTD #37 - Congrats moocowsgomoo!

So… this is probably an obvious question, but what does GiTD stand for?

Edit: Nvm, just saw the sticky.

 
Flag Post

Topic: Game Programming / Pros and Cons of subclassing

I am working on a version of hangman with some interesting programming twists. I don’t need to go into detail of what they are as the logic for the game is already finished. I can run an entire game by hard-coding variables for the user input (such as guess selection). I am now in the process of replacing all those bits that require user interaction with the trappings of an actual game like buttons, images, sounds, etc.

I am trying to figure out whether it is better to have all of this stuff be part of my main class, or whether I should create another class to handle it all. For example, I want my players to be able to click on an on-screen keyboard to make their guess, with each button firing a separate event listener call to the makeGuess function. Would it be better to create the buttons as direct children of my main game class, or should I create a subclass (called Keyboard, for example) that creates the keyboard section of the board with the appropriate events, then add the keyboard class as a child to the main rather than all the pieces? What are the pros and cons of each of these choices?

For the record, I’m programming using FlashDevelop, so nothing like a timeline for me.

 
Flag Post

Topic: Game Programming / Loading data from File objects

Final update: I didn’t even have to loop through the ByteArray. Final code to include a text file consisting of 60000+ words into my swf looks like this:

var test:String = new Assets.Dictionary().toString();
var words:Array = test.split(“\n”);

This gives me easy and quick access to the full list of words. Storing the entire list of 60000 words and accessing one of them in a trace took less than a second. The compressed .swf file is only 200kb at this point. Granted, that will increase when it’s more than just storing an array of strings, but this ended up being MUCH easier than I was making it.

Thank you both for all the help. It was what you said that got me pointed in the right direction. I really appreciate it.

 
Flag Post

Topic: Game Programming / Loading data from File objects

Actually, it looks like I don’t even have to bother. According to this page it’s possible to embed the entire .txt file, which I can then parse out based on newline byte characters. Even with 60,000 words, the .txt file is only .5mb, which means it shouldn’t take up too much room in my final .swf, even after parsing and storing as strings. I hadn’t realized that embedded it as a ByteArray which can be accessed directly. No need for File objects like you would in Java, or even xml (65mb for the same list)

 
Flag Post

Topic: Game Programming / Loading data from File objects

Thanks for the answer, both of you. Just to be clear, I’m going to need to convert the text document into xml (or JSON), then embed the file as xml. Then I can use the file directly, because actionScript has an xml object type that I can use to access it directly. Is that correct?

If so, is there an easy way to convert a text file (strings separated by newline characters) into an xml file?
Edit: It looks like Microsoft Word has a way to convert .txt files directly into xml, so that should work nicely.

 
Flag Post

Topic: Game Programming / Loading data from File objects

Honestly, I just thought that I had to use it to access a file. That’s what we have to do in Java, and I’m developing this program concurrently in both languages for practice.

How do I access the information from a text file if it’s embedded? With images, I have to create a BitMap variable and assign the image to it. I thought I would have to do something similar with the text file, and I just assumed it would have to be a File object. Can I just assign it to a String, or a String array, or something?

Edit: After a bit more research, it looks like I can use a URLLoader? How does that work with an embedded file?

 
Flag Post

Topic: Game Programming / Loading data from File objects

Problem #2: I can’t import flash.filesystem so that I can get access to the File object. I’m using actionscript 3 in FlashDevelop. I have no idea why I can’t import this particular object.

So, is there a way to either import this even though it isn’t showing up in my library? Or, barring that, is there a way to access the information from a text document without using a File?

 
Flag Post

Topic: Game Programming / Loading data from File objects

So you can embed files the same way you can embed images? I did not know that; I’m still getting used to actionscript. Thank you!

 
Flag Post

Topic: Game Programming / Loading data from File objects

I’m working on a new game based on a project I am helping someone with in Java. It’s a word-based game, and requires loading a large dictionary. In Java, I put the dictionary in a .txt file, create a File object pointing to it, and load it up with FileReaders/Scanners to put it into a data structure in my file.

I’m re-creating the project in actionscript, and there is an important difference between that project and the java one. The Java project only had to run locally, so I had some amount of control over where to put the txt file and where to find it to access it. I have no idea how to do that, and Kong only takes an .swf file. How can I get my dictionary loaded so that I have a list of words to use in my game?

 
Flag Post

Topic: Game Programming / Is there a website to get graphics/sounds/music/etc for free?

Thank you! These will help so much. You guys are awesome.

 
Flag Post

Topic: Game Programming / Is there a website to get graphics/sounds/music/etc for free?

Obviously for serious game creation I would want to make my own, but I have a couple of game concepts that I’m just throwing together to test the concept. It would be nice to find some graphics, music, or sounds that I could use for the concept testing. I’m terrible with artwork, so graphics would be a huge plus for my concept tests until I find someone to actually do them for me.

Any suggestions?

 
Flag Post

Topic: Game Programming / How to get High Scores tab to show up

Well, that did it! Thanks, I don’t know how long that would have taken me to figure out on my own.

For future reference, though, why doesn’t the high scores api show up automatically if you have implemented it? The documentation seems to imply that it will if you are using kongregate.scores.submit(score) instead of kongregate.stats.submit(“stat”, score).

 
Flag Post

Topic: Game Programming / How to get High Scores tab to show up

I have implemented the kong api, and I believe it is working. When I turn on the debug and view in the console, I see a successful connection to the server as well as a successful stat submission that occurs on start-up.

[Konduit] [Game→Service]: stat.submit: {"stats":[{"value":0,“name”:“High Score”}],req.id

This leads me to believe that I am connecting to the server properly and have the api working in my game, but the “high scores” tab is still not showing up. Anybody have any insight for me?

 
Flag Post

Topic: Game Programming / One game a month

I actually set this as my new year’s resolution for 2014. I’ve already submitted January’s! I hope someone creates a thread for 2014