-
yeah, I viewed that guys code for pong, and demoed his final project...the ball only moves in 4 directions...the 45s...but there is all this complicated math code, that ultimately does nothing....why is everything made more complicated than it needs to be ???
does flash monitor direction and speed...or do i need to set that up manually as well, it is a vector application, right ?...it can use vector notation of direction and speed...? as native to flash...or do I have to use a formula tto detrmine that based on _x _y values...please tell me the world's premiere inter-active vector art application has built in functions for dealing with vector movement...?
-
What they used to call vectorial in flash was not vectors to handle speed or acelleration but vectors like art,i mean, when you draw something in flash internally this picture is based on math so that, for example, it can be scaled with no loss of details
This is not the best aproach today, bitmaps are faster
-
-
yeah, I read them as much as I could..first couple pages I can read the math in...but I can grasp the concepts ok, it's just making sense of the formulas...it's all just tiny sets of symbols..guess I just need to plow through it some...did answer my question...flash requires much coding to perform simple vector based motion...ya think they would've gotten setVector(dir,speed) in there...and what pray tell exactly is a radian...a measure of angle..based on ?
I tell ya, the stuff they don't teach you in class....but hey, it is only my first year in flash..
-
ok squize, what if pong is over my head...maybe I'm just not meant to code, haven't gotten very far in 8 years trying to learn...
-
Pong isn't over your head at all, esp. if you've written breakout in a different language.
Don't have a hang up about copy / pasting code, grab whatever you need to get it done, and try and understand it afterwards.
Firstly, pick a language to code it in. I'd opt for as1 ( as2 is a ton of work to set things up when you're first starting, and as3 is just a different planet all together ).
Check this thread, http://board.flashkit.com/board/showthread.php?t=670156 that's my trusty old as1 template. That was the basis of every game I did when at preloaded so I know it works.
So you need a player bat. Draw a rectangle and convert that to a mc, and give it an instance name.
Using the template add movement to the player. So you're going to need to read up on Key.isDown and just be able to move a mc using it's _y property. Also you'll need to test for it staying on the screen, ie boundary checks.
See how you get on with that, but use the template, it's set up so you can make a real game with it rather than just making a game which won't reset after a game over ( Something which messes up a lot of the newer coders ).
Squize.
-
oh, very sorry I have been gone, whole family got hit with a cold...but we are starting to get over it. I did go over your template, and I have set up a basic board, I will upload what I have 2morrow.. thank you guys for your help...barely able to breathe...sinus pressure, eh you've all been sick a time or two I'm sure...
-
It's funny... I remember you offering me the same template. I never used it because it always seemed like overkill and/or never came close to outlining how I code. :p
-
Overkill ? Really ?
There must be around 20-30 games built around that baby. For as1 I just found it a nice structure to work to.
Squize.
-
http://board.flashkit.com/board/showthread.php?t=544413
Please follow this tutorial.
It has simple collision responses, and simple movement code, and handles things like collision detection and keyboard/mouse input. Learning Pong is a fundamental step in game programming in my opinion.