Solved

Need a game like 'Arcanoid' Quickly!

Posted on 2001-06-20
6
182 Views
Last Modified: 2010-04-02
I need a game that is simmalar to the arcade game of "arcanoid". Using an icon for a ball and using a my mouse to move a paddle from left to right.
My problem is making the ball to bounce off the sides of the screen and making the to be seen and to move from left to right.
Please help.
E-mail amswer to me @:   D_B_Vipe@hotmail.com
Thanx you.
0
Comment
Question by:Mo
6 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6212103
So exactly what is your question?
Do you have some code already?
Post what you have?
0
 
LVL 2

Expert Comment

by:smitty1276
ID: 6212127
Noone is going to email an answer to you.  If you want the answer you are going to have to come back to this site and read the suggested remedies to your problem.  When you find one, you will then ACCEPT THE ANSWER... something you cannot do if the answer is emailed to you.

Somehow, though, I have a feeling we will never hear from you again anyway.
0
 

Author Comment

by:Mo
ID: 6213406
question1. How do I mahe the mouse to move only left and  
           right and not in any other directions?
question2. What is the coding for the ball and/or icon to
           bounce off the edges of the screen?

I do intend to stay on for a long time cos in Africa education is crutial
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Accepted Solution

by:
MDarling earned 100 total points
ID: 6213597
q1: you don't - you make the bat move left and right.


just draw the bat at the height you want with the x position of the mouse.


q2:

let x,y be your ball position
let dx,dy be your ball change vector (initially 1,1)

let sx,sy be the width and height of your game area

while true

  x=x+dx
  y=y+dy

  // bounce off right side
  if(x>=sx) dx=-dx
 
  // has ball gone off bottom
  if(y>=sy) end of game

  // bounce off left side or top
  if(x<1) dx=-dx
  if(y<1) dy=-dy

  // bounce off back
  if x,y is touching top of bat dy=-dy

  get user input
  do game rules - collision etc
  do game graphics
wend
0
 

Author Comment

by:Mo
ID: 6217512
How do u get the ball moving?
0
 
LVL 22

Expert Comment

by:nietod
ID: 6222858
Does anyone know if this accepted answer was posted as a comment or as an answer?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Getting IP address 8 71
Grammars for C C++ and java 1 114
is twain_32.dll cmpatible with windows 10 ? 10 128
Need some help with Microsoft Visual Studio C++ 2003 5 53
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now