Dealmaster13
502 posts
|
Topic: Game Programming /
Help making a freeroam game.
There’s nothing wrong with trying out a bit of character movement and moving on from there – I got to grips with AS3 that way; so give it a shot (minus the multiplayer)
Start off with a bit of character movement and shooting mechanics like in your tank game
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Do you think that the operator is is just as useless then, Truefire (using your argument that you can always structure your code such that these results are attainable pre-compile)?
It’s hard to claim something is useless just because you have no use for it.
|
|
|
Dealmaster13
502 posts
|
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Originally posted by truefire:He probably doesn’t, if this was the most interesting thread he’s seen recently ;P
Oi!
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
2 Constructors, 1 Object.
I believe Java has this ability (which is only useful when the parameters are of different types?).
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Speed shouldn’t be a concern.
player_03’s is fine.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
Currency
The reason why currencyDisplay is not updating is because Number is a primitive data type, which means when you assign it to a variable (currencyDisplay.text in this case), it is copied by value rather than reference; i.e. you’re copying the contents of currency (100) rather than the pointer to its memory location (currency itself).
Simply update the text field every time currency changes.
You could create a public function that has the sole purpose of incrementing currency within which you can tell it to update whatever you need.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
Possible legal issue with revnue
I would suggest that; yes – for payment details.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
Under judgement
You can view a range within which the rating of your game lies by favouriting several games and then viewing your favourited games sorted by rating.
Azuana Dominoes has a rating of between 2.04 and 2.31
How many views you get greatly depends on what time of the day you upload it at, however I highly recommend that you don’t reupload the same version of your game.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
Post your debugging tools
Originally posted by GamerFefan:
Trace is annoying for me because it doesn’t track the time of when it was actually traced (which really helps) and it seems to always get overcrowded and clog the output box up.
So I just quickly made my own that shows up/hides when you press ~. It also has a little command box so you can type your own commands, which can be very useful for shortcuts. :3
Link.
Just as a quick heads up, in your RunCommand method you can make use of the default case.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Interesting idea player_03; I think I might just implement that. Thanks!
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
You probably didn’t read the whole topic, but also unknowingly suggested a very nice thought, but unfortunately it doesn’t work without instantiation.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
MovieClip Base Class
You might find better help on the matter by posting in the Adobe forums?
|
|
|
Dealmaster13
502 posts
|
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Creating the object will change variables and create event listeners.
I think it’s safe to say that there is no up to date built-in solution.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Comparing classes; not objects with classes.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Yes, that is correct, Draco, however I’m not going to store what each of my classes extends with the hope that there is a more elegant, ‘behind the scenes’, solution available.
Your code does indeed work, Bob. I apologise for not trying it out earlier. instanceof is of course depreciated however, so is there not an alternative method? It seems strange that while is is supposed to mimic instanceof ’s function that it should not behave in the same way.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
Originally posted by BobTheCoolGuy:
Try something like:
if(ClassA.prototype instanceof ClassB)
And ignore the instanceof is deprecated warning.
instanceof uses objects (instances), which is not what I’m after.
Originally posted by simplegoogly:
Originally posted by Dealmaster13:
I’m wanting to make the comparison without instantiating anything.
Thats a bit strange. what are you trying to do?
Also bob I dont think that will work.
I have, say, a specific weapon/turret class, MachineGun. The hierarchy works as so:
MachineGun —> OffensiveTurret —> Turret
I want to know if MachineGun is a Turret and not a Building or an Animal without using a user-defined lookup table for subclasses of Turret.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
I’m wanting to make the comparison without instantiating anything.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Comparing Classes
It is possible to take an object objectA of type subclassA which is a subclass of classA and check if objectA is of either of these types using the statement: objectX is classX (AS3 will check as many superclasses as necessary).
Say you have several user-defined classes, classB, classC, … and classZ. classB is a subclass of classC, classC is a subclass of classD and so on, with classZ being the most basic class.
Like the first example, how would I check if classB is a(n indirect) subclass of classZ?
http://www.kongregate.com/forums/4-game-programming/topics/202566-as3-comparing-classes?page=1#posts-4380559
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Strongly Typed Arrays
Originally posted by qwerberberber:
Haxe。
That would make sense, I think
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Strongly Typed Arrays
I saw one of the coders on the live stream use code such as Array<Float> just as you would do with a vector without the point.
…and at this site we have the following:
It’s worth mentioning that the speed is actually about the same when using the array strong type method versus the Vector method, so if you already use the first method, there’s no need to use Vectors for performance reasons.
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
AS3 - Strongly Typed Arrays
Heya,
I just realised today whilst watching Big Block Games’ live stream that you can actually type an Array just as you would type a Vector, and after some quick googling, it seems that they have a similar performance.
So that’s sparked a few questions to ask:
- What Flash Player is required to utilise a typed array (because vectors require FP10, I’ve naively been refraining from using them to make my project as flexible as possible)? How would I look up info like this (the livedocs hints at FP versions but doesn’t give a definitive answer for typed arrays)?
- If the answer to the question above is FP9, what do you gain from using Vectors?
|
|
|
Dealmaster13
502 posts
|
|
|
|
Dealmaster13
502 posts
|
Topic: Game Programming /
Checking rating while under judgement?
The way I used to check mine way back was to view the top rated games for my particular game’s genre, and I believe whilst under judgement it would still place itself somewhere amongst the list (i.e. you could work out the range). Alternatively favourite your game amongst many others.
I can tell you that you have a rating between 2.31 and 2.65
|