I really want to program in as3, not really because of its many new classes, but because its just the in thing. Programming in as2 was really given up in 2006, and geez its now 2013. What rock have I been living under. Well I think it comes from picking up computers back in the commodore 64 and turbo pascal days. Im quite happy with functins, or even objects that contain groups of properties and functions. But the next big step is classes. I was always comfortable with an object for everything, and everything has an object to control it. But then u cant really have 2 objects of the one object, they share the reference, so I guess it goes to say, good try hey. Not really classes, but a new parady to OOP programming, flash object based programming, completely non OOP, although completely object orientated, lol. But strickly lol is not a word, or is ur, so your I mean my problem is now to progress,...
I looked as flash as3 for the first time recently, and did a 12 mnth course in java class based programming the year before. Now I have the skills to easily write classes in AS3. But then comes the daunting task, classes talking to each other. They are now a model, and a structured flow chart type of state machine. They are not just a huge collection of C like functions, with javascript orientations of grouped object properties and methods. But a class based approach is not easy for the first few times, to just create. Ive spend a few years creating, and its all about inspiration, and quickly get things done, quickly pick the perfect picture, that later even after endless hours of searching nothing can be found better, that was found and used in the final product within 5 minutes of looking. I like art, and I love the programming side of it, the control it brings to breed the inspiration into design. But sorry going on, the move from as2 to as3, really needs classes to be used. I guess I could just used objects again, but get with the times. If classes are introduced, then u can get confused with the overall structure, endlessly, unless a plan is made, and depending on how much you have learnt about planning, a simple box diagram, is often ok. But it makes u think, why not do it in argouml with all transitions and state machine diagrams, click compile diagram, and the basics of the program are written. Its an entire new approach, that requires classes, to be defined in theoretical properties and simple methods, that even after 12 mnths, seem a long way from a fun design, to a boring database endless planning design. I recall my teacher, I guess with 20 years experience, writes code that is simple. Each function does one thing, and that thing is planned with precision, to use the IDE to its best advantages to keep the code as readable, upgradable, portable, and simple as absolutely possible. I like art and programming, but I dislike endless hours of planning when even thinking of classes. I cant wait to I get to the ability of writing the simpliest of classes from day 1 in a project. But one step at a time....
The ability of classes to talk to each other in AS3 revolves around an event based system, rather than a poll passed as2 api, where the entire system is on a sleep timer. I have now got good systems to send and receive events from static and non static classes in as2, with event bubbling custom classes. I don't yet have a specific Timer class, but that would be one of the next steps. I don't have many steps to go, I have a custom tween class, that lets u load up multiple mcs, into the tween object and start them all at once, while a FPSControl class benchmarks your computer, and sends back a scaling factor for all animation. Unfortunately in browser based usage of the flash swf file, it is all limited to 60 fps. But with the FPSControl class, if the user changes to run the swf by itself in the windows environment, the fps can be changed to perhaps 300 fps, and all the animations will animate the same. Major performance degregations occure around 500 to 1000 fps, where u get about 50 percent efficiency. But all pointless on a 60 hz monitor, and it is only a animation. I was just interested on what happens to flash as u push 1000 fps, then slowely load it up with moving objects, all intervals and the main movieframe rate, slow down one at a time, as the poll based system, slows down from the 1000 all the way back to say the movieframerate of 48 fps, which is when any animations running at the 48 fps will then start to slow down. I guess this is all very obvious and how a proper professional animation programming API should work. But just nice to have firm knowledge on how they run.
So AS2, to AS3, with a good grounding in java class based programming, and I now have a range of utility classes for intervals, tweens, delegation, btns, and perhaps many more to come. But i have to come to a stopping point. The classes have the ability to send events to each other, and when not, i can use some global static functions, although not that good a solution, usually means bad design. I have the skills of UML design, some of the diagram techniques i don't really like, i found state machines to make the most sense from a design perspective, but the end product often becomes too state machine orientated, every class having states. it simplifies things, but it would be nice as the state machine diagram to just be a tool. To aid the final product development, rather than define it. Im sure many years of this, i will get the hang of classes but for now i have one project, and one goal,....
Finishing a slot machine, called celebrity jackpot, i wrote in 3 weeks in January 2013. Then took a month off, cause it was just getting messey. Then tried a class based approach and spent 2 months trying to do better that i did in January. Its now May and im not stuck, but confused over something simple,...
Flash movie frame rate, has to be the same as the music video frame rate. I coded them all at 25 fps, then imported into flash at 48 fps as movieclips. It all works well, playing 15 clips at once, but i haven't got much play with animations running at the same time as music video clips. Or the after 15 seconds the videos are out of sync with the music. I might or could do a test, and change the main flash movie frame rate to 25, and re import all the music video clips. I guess if im running animations on intervals at 60 fps, and the 15 music video clips at 25 fps, i would have 35 fps less weight, before the videos start to slow down, instead of 12 fps what ive got now.
So in the interim, before i make this big step, of changing a professional slot machine, main movie base frame rate to only 25 fps, just to suit the 25 fps coded music video clips, it just seems to low for good quality animation. But im not a professional, i don't know what is done in industry. perhaps this is the key, ... flash as2 is poll based, it slows down gradually, its all about design, and priority of lots of intervals,...
And i don't really want a interval register class, that tracks an entirely interval based slot machine, just to cope with the press of flash rewind, that clears all the intervals,...
Maybe, just churn this one out, and then make another slot machine,..
But the idea, was money in, money out, and a perfect class based, alterable slot machine,..
Now i want a framework, to make a heap of slot machines,..
What i have now is a mess, i will get there, but its going to take time, ive done the learning, now just time, and time i haven't got. Its getting there. And i might finish the graphics of at the weekend, im sick of stuffing around with classes.
No comments:
Post a Comment