Evening people, I've been working on my first Android app for a few days now and it has been going pretty well however I've run into some problems when trying to add an AI paddle (bat).
I fully understand the logic behind the functionality (or at least I think I do!) but due to my lack of knowledge when it comes to java I'm unable to somewhat portray it on screen.
So I currently have a bat at the bottom of the screen ( which is moved left and right via buttons located in the bottom two corners, planning to implement alternate means of control in the future) A ball which bounces off the top, left and right sides of screen and of course bounces off the player controlled bat.
My plan:
I'm trying to implement an AI controlled bat along the top of the screen and have plans on how to calculate the chance of it missing etc that's not an issue, collision detection will also be fine as I can simply mirror what I have already done.
My problem is, I cant figure out as to how I am going to get the AI controlled bat to 'follow' the ball in a smooth fashion or even follow it at all..
Any help or pointers would be so helpful,
The link to my project code is just below, do excuse any horrific code
https://www.dropbox.com/sh/idms12imhdu4rh8/EnqAoxNWsZ
Cheers !
Ben
I fully understand the logic behind the functionality (or at least I think I do!) but due to my lack of knowledge when it comes to java I'm unable to somewhat portray it on screen.
So I currently have a bat at the bottom of the screen ( which is moved left and right via buttons located in the bottom two corners, planning to implement alternate means of control in the future) A ball which bounces off the top, left and right sides of screen and of course bounces off the player controlled bat.
My plan:
I'm trying to implement an AI controlled bat along the top of the screen and have plans on how to calculate the chance of it missing etc that's not an issue, collision detection will also be fine as I can simply mirror what I have already done.
My problem is, I cant figure out as to how I am going to get the AI controlled bat to 'follow' the ball in a smooth fashion or even follow it at all..
Any help or pointers would be so helpful,
The link to my project code is just below, do excuse any horrific code

https://www.dropbox.com/sh/idms12imhdu4rh8/EnqAoxNWsZ
Cheers !
Ben