Results 1 to 2 of 2

Thread: hitting against a wall -"break out"

  1. #1

    Thread Starter
    Fanatic Member merhaba's Avatar
    Join Date
    Sep 2002
    Location
    Istanbul,Bartin-Gallipoli(Gelibolu-Canakkale)
    Posts
    601

    hitting against a wall -"break out"

    Hi,
    I know how to code a simple "collision detection" in java script but I would like learn more about "an object hitting against another object(a wall) and move all around the room.randomly.just like in a "break out game"
    could anyone give me a short sample of codes of that kind?
    thanks

  2. #2
    Fanatic Member McCain's Avatar
    Join Date
    Jan 2002
    Location
    Sweden/Denmark
    Posts
    802

    Re: hitting against a wall -"break out"

    Well, the ball in a break out game doesn't move around randomly. It calculates the new angle everytime it hitts the wall or a brick. You could do the same.
    Just find a basic pong type of game in any language and translate it to JavaScript.
    It's all about checking where the ball is and where the walls are.
    Never argue with fools, they will only drag you down to their level, and beat you with experience.

    Q: How do you tell an experienced hacker from a novice?
    A: The latter thinks there's 1000 bytes in a kilobyte, while the former is sure there's 1024 meters in a kilometer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width