Recent posts by Kingfish34 on Kongregate

Subscribe to Recent posts by Kingfish34 on Kongregate

avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

I really hate bash fests. That was not the point of this post and I am sorry that it ended up this way. Can someone please just close this thread now so it will stop.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Originally posted by Moly:

I’d take your opinions more seriously if you could go one post without saying “obfuscation”.

Freaking hilarious and

Originally posted by Vulture:<brOOP as obfuscating things. Really, it’s Java that obfuscates things — many other OO languages are much more understandable. I appreciate Adobe’s decision to make AS3 follow the ECMAScript standard as much as practical, but I find it regrettable that ECMA wants things to look like Java….

Everything I agree with accept this. I do not think Java obfuscates things at all. Anything written poorly enough can be confusing to anyone. Java was a major step away from the confusion by starting with C++ and removing the pointers that were so confusing to so many people. Also got rid of (which I think was a mistake) the ability to do multiple inheritence. Java was a big jump forward in making OOP more accepted due to the incredible amount of complexity taken out of the language, yet keeping it very powerful. Now some newer languages have come along that have some really nice features like C# but Java was the first mainstream language to be really OOP, powerful with a relatively small learning curve. Hence it’s undeniable popularity and persistance. Please noone point out some of the other languages prior to Java that also contained these elements but didn’t survive like Objective C. I am aware there were others but it survived.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Maff Help: Trig

Sadly I have a degree in Math and I agree with your comment on Trig. I just think it sounds stupid to say angle off of a point because to have an angle you need a direction which you can only get by having a Vector. Even though I also hate Trig understand that if you REALLY want to build a game in 2 dimensions (we won’t touch 3 d here) then simple vectors should be understood. I ended up coding my stuff by creating a Vector2d Class.

Basic pieces of my Vector class in psuedo code you’d need to clean it up to use:

 
public var x:Number;
public var y:Number;
public var oldx:Number;  // Used to avoid calculating length over frequently
public var oldy:Number;
pulbic var length; // Only calculated when accessed to increase efficiency

public function get length() {
   if (oldX!=x || oldY!=y) {
      oldX=x;
      oldY=y;
      length=Math.sqrt(x*x + y*y);
   }
}

Other methods I added…
normalize
add
subtract
multiply
divide
getReverese
isParallel
isPerpendicular
getPerpendicular():Vector2d
dotOf
angleTo(vector:Vector2d):Number
distanceTo(vector:Vector2d):Number
set(x:Number,y:Number):void
rotationbase():Number // The rotation from 0,0

And a few others which I won’t mention.

I will promise you things get alot easier when you start using a Vector in all of your entities or Sprites as the case may be. Again when I say 2 dimensional I mean a game acting across a plane not a game played in 1 direction which in essense is almost 1 dimensional (not reall I know but I think you get my point). Games firing around 360 degrees and moving around 360 degrees.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Moving help

Program it. I don’t get your question. When you receive the key action you handle it and move your Sprite whatever hell direction you want to move it.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Maff Help: Trig

First understand mathematics. There are no angles of points. It is a vector. So, like Moonkey said point right meaning a vector pointing →

Anyway, obnoxious I know but can people please not refer to angles off a point. No such thing!

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Making Intelligent Enemies? [AS2]

Free – Positive, pre-release – negative so not sure if I can use it now but man that is a good feature and even if there isn’t enought interest they could internally rewrite all of Math using it it would make AS run better so NOT a bad thing. Moly awesome addition, thanks.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Making Intelligent Enemies? [AS2]

Adobe Alchemy!? I am not familiar, is it free? I like the sounds of that.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Making Intelligent Enemies? [AS2]

I agree but if you want to learn AI you pretty much are going to only find good examples (and books) in C++. Why? Because C++ is very efficient and most AIs are INCREDIBLY processor intensive and you need fast code to execute. I have translated a bunch to AS3 and trust me you have to be cognisant of the AI processing requirements as you become more sophisticated.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / hittest not working sometimes

Moly challenged the geek in people so it became a performance proof instead of answering your question. Regardless I think leaving dead elements in an array is poor design.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Help Please

Outside of a timemachine no. Some programs auto save for just that what was your IDE? And see if it has a recovery feature.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Help with shootorial! New problem!

49 minutes later and you still need help. I thought you would solve it by now. Why are people so impatient on this board? It takes people a while to get around to being able to answer your thread. Not familiar with AS2 or the shootorials so can’t help myself.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Variable randomly doing...something odd

Originally posted by geel9:

sigh

You have no idea at all. IT HAS TO BE THIS WAY.

Nothing has to be anyway. Floating point values are guarenteed to have slight inacuracies so that has to be that way. (contradiction!?)

Basically when I say trace (15/10) then I can easilly get 1.500000001 or 1.49999999 or 1.5. It is a reality and there is nothing you can do about it but learn how to deal with it. It will always be a reality because computers have a finite representation of numbers.

For example tell me how to represent 1/3 as a decimal? The answer is .3 to infinity but we just don’t have that much memory in computers to go to infinity (that was a joke). So, decimal rounding always happens in computers. Nothing you can do about it. Plus I have never dealt with a problem that I couldn’t think of at least a number of ways to go about solving it. Think outside the box my friend and you will find a lot better code from it.

By the way if I want to know when a decimal value is reaches a certain point lets say HPs for a enemy and I want to know when he needs to die first the wrong way. Note hps is a Number.

if (enemy.hps==0) {
  //kill me enemy
}

This is BAD!! Instead I’d say…

if (enemy.hps<=0) {
  // kill me enemy
}

Ahh now he dies corectly. If I really want to check a certain point and time then I’d say (basically can’t see a good reason to do below but since I brought it up)

if (enemy.hps>1.98 && enemy.hps<2.02) {
  // Enemy is at 2 hps  oh no need to do something cool
}

Notice how I actually gave it a range. This is to deal for this floating rounding issue I already mentioned. I would pretty much never see a need for the above but I don’t know you brought it up.

Maybe your for loop could look like this…

for (oldpo = po – 1.8; po >= (oldpo-.002); oldpo += .1)

That would cover the rounding situation.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Where can I download flash

Originally posted by VoltageGames:

You can download the free trial every month for free from www.Adobe.com also it is better on a mac.

Uhmm that is illegal it is a 30 day trial not a recurring 30 day trial. Please don’t encourage illegal activities. And there are free alternatives like Flex which is what I use. But if you don’t know how to program then yes it is hard. If you do then not so bad.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / hittest not working sometimes

Another possibility is that your bullet could be moving to fast. What do I mean? Basically if you have a Sprite who’s dimensions are 40X40 and a bullet who’s dimensions are 2X2 and the bullet is moving across the screen at say 1 pixel a millisecond. You have a timer that is checking this hittest every 100 milliseconds then at point 1 then the bullet will have moved 100 pixels since last check. So, in this case it would almost never actually be true with a hitTest. This is an extreme example but hopefully you get the idea.

Basically you are checking to see if two Sprites overlap at a point in time. Most likely both are moving and you are checking at certain intervals (enter frame or time). The problem is you will ONLY register a hit if they overlap during the check but not if they overlapped between the intervals. The correct way to deal with this is to draw a vector (abstractly draw with math) from previous point to new point for both objects and see if they overlapped (based on their dimensions of course) but most don’t want to do the math. Otherwise you could check more often or change the movement speeds, etc.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / action script help!

Hello.

Dude, you post and then post again ONE HOUR later cause noone has responded. Jeez dude, try not to be a jerk and expect people to be waiting around for you to post.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Making Intelligent Enemies? [AS2]

You are discussing AI and there are alot of pieces to decent AI.
First I recommend the easiest part which is a Finite State Engine. Basically, monster has states depending on what is going on. States I see possible for you. “Wait” which he stays in until an event such as door open occurs or whatever. “Attack” which is the state he moves in once door is open or could have a pre state of “Ready” when the door opens for something to come in site this way you only check for enemies while in Ready state. “Flee” when HPs gets to low goes into this state. “Pursue” if enemy moves out of range to follow enemy.

Second, if you want the monster to do more than stand and fire then you need some sort of Steering behavior. This can get very complicated but I’d recommend learn how to utilize 2 dimensional Vectors and read up on it.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Weak references is the way around event listeners not keeping things open. I thought by default AS3 used Weak References, someone let me know if I am mistaken but I know that when I remove an object in my code I can’t find it in the debugger so I assume they are weak references. If they are weak they SHOULD NOT hold a object open. What is a Weak Reference? Wikipedia is a great tool.

Okay I didn’t know the execution improvements but WOW, they are actually huge. And honestly “obfuscation OOP adds”, please. I think if anything something written in OOP loses obfuscation unless it is written poorly. You really think a huge block of speghetti code is less obfuscated then things broken out into readable objects? Sorry this argument holds no water. OOP significantly reduces coupling and obfuscation.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Also, when eventually AS2 is no longer supported there will be alot of the typical outrage and whinning and crying. Adobe will release statements supported it’s decision and after a number of months noone outside of the few whinners will care. Adobe will have moved on and everyone else will have no choice but to move forward as well. It is an eventuallity and a guarentee that AS2 will not be around forever and equally true that AS3 also won’t be around forever.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Points taken sorry I brought this up. Couple of small comments about the future, AS4 will NOT bridge AS3 with AS2. This is not based on any personal knowledge just a general knowledge of how things progress in technology. They go forward not backwards and eventually demand that everyone follow.

IE AS4 will be released with a new product called FLASHIER which will still support things written in AS3 but nothing before that and all FLASH users will upgrade to FLASHIER to run AS4 programs. Technology is a unique industry in that it changes VERY rapidly. The world of the internet is evolving constantly and therefore demands on what people want to see on the internet is changing. First there were simple static HTML websites now they are dynamic with powerful features like AJAX so they can act more like applications. First there were search sites based on pure spider searches like Altavista, now there are search sites that use algorithms to give people better results. Recently social networks through Facebook and myspace have taken off. Twitter is a new concept. Adobe will want to exist in these ever changing lifecycles on the internet and so the product will evolve to better serve their needs. RIA really help with the idea of dynamic sites and I suspect ideas like tiny hidden Flash programs interacting with javascript might be seen to make websites have more pazazz without embedding the entire Flash experience. AS3 was adopted because of the flexibility a more robust language offers so trust me when I say it isn’t going to do any bridging, AS3 will most likely evolve more to handle new aspects leaving AS2 behind. AS4 who knows when that is in the works and I am just trying to say that things move only forward not backwards. AS2 support is only around as a temporary stop gap (ala temporary for a number of years) until Adobe feels like the cost of continued support out weighs the cost of making their product include the new features they want to add.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

I started out with Flash and found it pretty frustrating. When I moved to Flex and started using Flex Builder I actually found it much more intuitiive and easy to use. I would like to add that I was already pretty familiar with Eclipse which is it’s framework so maybe that might be why, but my god I can produce things faster in Flex then I ever could in Flash. I think I just do better with programming everything and just having pngs and the like for sprites.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Preloader

Whichever, I think it is easier to pre plan in Flash CSx. Big ole pain in but to go back and force in later. Flex really doesn’t matter because it takes two seconds.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Just a side comment. Flex Builder isn’t free (in general) but Flex SDK is. So, you can always use the Flex SDK just fine. Even though I think Flex Builder is a great application. Much better than CSx for coding. Graphics CSx coding Flex Builder.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Repurchasing CSx is a very good reason. But why, it is so cheap. Who doesn’t have 699 dollars to drop on it?

Edit just proving I’m not retarded as some people seem to think. I can flame myself thank you very much.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

Originally posted by Haelix:

OOP as a concept is just another way to solve a problem. You can argue the progressive, “cutting edge” nature of the newer language.

Uhm you are implying that OOP is something new and cutting edge. I believe OOP was invented in the 1960’s, it became popular in programming languages in the early 90’s. I would say that is far from cutting edge. I have worked in Assembler, C, for the first few years of my career and migrated to other OOP languages later like C++ and Java. And I can tell you without a doubt programming in an OOP language simplifies the understanding of a project especially as it grows in scope. So, yes it is a tool but come on, the entire industry didn’t adopt it as the standard because it sucked.

 
avatar for Kingfish34 Kingfish34 135 posts
Flag Post

Topic: Game Programming / Love affair with AS2

If you do a search then there are plenty of tutorials that I think are tons better than shootorial written in AS3 that could be followed. Look on asgamer.com for example they have some good tutorials using CSx of course. I program in Flex now.