Solved

# Need a game like 'Arcanoid' Quickly!

Posted on 2001-06-20
172 Views
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.
E-mail amswer to me @:   D_B_Vipe@hotmail.com
Thanx you.
0
Question by:Mo

LVL 30

Expert Comment

So exactly what is your question?
Do you have some code already?
Post what you have?
0

LVL 2

Expert Comment

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

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

LVL 3

Accepted Solution

MDarling earned 100 total points
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

How do u get the ball moving?
0

LVL 22

Expert Comment

Does anyone know if this accepted answer was posted as a comment or as an answer?
0

## Featured Post

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.