What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Hey all, I just finished my first game and as it’s mostly meant to improve my skills I was wondering what the people here think of it. I realize the gameplay isn’t that great.
I also have a specific question. In this game I have a lot of repetitive code because every cow requires its own code. As a result I have way too much code that’s nearly identical. How can I prevent this?
I use AS3. I dont really know how to do solve this with a custom class. I’ve used them twice while following a tutorial but I’m not very good at it yet.
Im currently not at home so I cant provide any code but my repetitive code is similar to this:
If you would like to see more I’ll upload my code tomorrow.
You could go something along the lines of:
You’d have to check what the event target outputs for each of the cows first though, not just use “mcCow1”.
And weaponType would just be the type of weapon you are using, as a String, so that you don’t need to have checks for the weapon type/different event listeners.
You could also go so far as to:
if(event.target is of Class cow) event.target.gotoAndStop(weaponType)
But I don’t know how to do that properly, you’d have to ask someone else.