NNKL.COM
welcome to my space
X
Search:  
 HOME   trigmetry and breakout
trigmetry and breakout
Published by: admin 2010-03-12
Welcome to:nnkl.com

  • alright i want to make my breakout game better because i have it so when you hit a certain spot it goes to a set direction,i want it so if it comes in from the right and hits the wall it will go the opposite direction and vise veras if you know what i mean,

    someone said that i could do this with trigonometry, but i really dont know how to do this with flash could someone please help me


    please like a tutorial or something


  • No... If the ball hits off the left or right hand wall it would be

    xspeed *= -1;

    If it hits off the top or the paddle

    yspeed *= -1;


  • this is a variable thingy. can someone please look over it to see what my problem is. because i want it to randomly hit the wall w1 w2 w3 and w4 but i rally dont know how to do thisso ya will some please help with this fla


  • just for kicks, heres the first game I ever did (waay long ago):

    http://www.geocities.com/flash4food/game.html
    portal.gazages.com - Archives 20080801 - Powered by chcms::
    trend clothing online - Collected by: admin - 2009-09-29 trigmetry and breakout - Collected by: jack - 2009-09-29 very frequent stomach pain - Collected by:
    http://portal.gazages.com/recentpostarticle.php?d=20080801
    HOME
    trigmetry and breakout - cfzr.com - Powered by chcms::
    alright i want to make my breakout game better because i have it so when you hit a certain spot it goes to a set direction,i want it so if it comes in from
    http://cfzr.com/cfzr/cfzrenarticleZ/trigmetry-and-breakout-525684.html
    HOME

    its a little buggy, and i am too lazy to correct it know but i think it is great for a first
  • xn--vuqv07a7mbt96d5kt.com - Archives 20080506 - Powered by chcms::
    tornado days climatology - Collected by: anonym - 2009-11-29 trigmetry and breakout - Collected by: webmaster - 2009-11-29
    http://xn--vuqv07a7mbt96d5kt.com/recentpostarticle.php?d=20080506
    HOME
    zjbr.com - Archives 20091130 - Powered by chcms::
    trigmetry and breakout alright i want to make my breakout game better because i have it so when you hit a certain spot it goes to a set direction,i want it
    http://zjbr.com/recentpostarticle.php?d=20091130
    HOME


  • Just play around with the elements and variables, and it will start to make sense.

    Let me know how it goes.
    portal.htmlr.com - Archives 20081146 - Powered by chcms::
    trevor pleased for joe - Collected by: jack - 2009-12-22 trigmetry and breakout - Collected by: anonym - 2009-12-22 weird bite with retainer - Collected by:
    http://portal.htmlr.com/recentpostarticle.php?d=20081146
    HOME

    Steve


  • hey, that's very cool - I like the originality of one person playing both players depending on which have of the field the ball is on - I've never seen that before. It's good to start with something simple, like that too - very nice, thanks for sharing.


  • hey that is really good

    do you think you could teach me how to do that

    please.....


  • Bombsledder,

    I've created a simple version of Breakout called Bust Through:

    http://www.plasmicstudio.com/bustthrough

    To kind of up the ante from the original game, I added some inertia to the paddle. The angle that the ball hits the paddle, or the bricks, affect the angle. And, every time your paddle hits the wall, it chips away a tiny bit of the paddle's width.

    If you think the .fla for this will help you out, let me know and I'll send it to you.

    Steve


  • your fla is like messed up it is when you test it, it is like witdhing through frames and such, but i dont want to basically steal a script i want to be able to make my own script out of knowledge but i guess i will expeirement


  • i think that for breakout thers no trig, say you have two variables for controlling the ball (xspeed and yspeed) its as easy as multiplying them by -1 (higher number for speeding up or lower for speeding down)

    but not the 2 at the same time, if the ball hits a vertical wall multiply xspeed and with a horizontal wall multiply yspeed


  • im so confused


  • hey thanks for the help


  • Okay - you can take any scripts you want, though. It wasn't an original game, I only tried to recreate Break Out as an experiment - I was playing the original game on one of those Atari joystick ten-games-in-one things someone gave me, and the gameplay was horrible because the original game used paddles - but the joystick movement was fast and harsh. So, I primarily recreated it just to see how it would play with some real inertia, and kept adding little touches.

    Enjoy, have fun.

    Steve


  • 'd amn' isnt allowed to be used in the forums???


  • Okay, I'm not sure what "witdhing" though frames is, though - and I don't know why the fla is messed up - you might want to try downloading again. Either way, you could just study the scripts. Good luck experimenting.

    Steve


  • No problem - the .fla is here:

    Bust Through Flash source file (http://www.plasmicstudio.com/bustthrough/bustthrough.fla)

    - there's some complex stuff with some of the effects (like the paddle chipping or the blocks exploding), but the core movement of the paddle and ball are contains in their codes.

    The inertia coding in the paddle was taken from another tutorial on here - I forget which one. The comments explain both variables that control the inertia, which you can experiment with - I'd recommend copying and pasting just the ball and paddle into a new Flash file, and experimenting with them alone.

    Enjoy - let me know if you have any specific questions about the code.

    Steve


  • more like

    if (this.hitTest(wall)) {
    xspeed *= -1
    }

    **** too slow

    -zylum


  • alright thanks dont worry im not going to take anys script just gonna use to learn it


  • so something like

    if(this,hitTest(_root.wall){
    xspeed=-yspeed
    }

    and that for the rest of the walls or something like that





  • Get Smart About Monitoring Virtual Machines
    Microsoft Gets Ex-Streamly Cozy with U.K.'s MediaWave

    You are looking at:nnkl.com's trigmetry and breakout, click nnkl.com to home
     
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 nnkl.com        Site made:CFZ