AI for Pong

Hi everyone!
I'm helping a friend to write an AI for a pong like game.
I try to do it to look like a human player.
so there is the impossible to beat basic paddle behaviour for the game:
1.when ball is towrds the paddle, move the paddle x to the ball x.
2.when ball is not towards the paddle, move the paddle to the screen center.
now this is not AI.
what i did till now, is that: ihave a State Machine for the paddle. it changes it's state according to its location, ball's x location and ball's velocity.
1.when ball is not towards the paddle, the paddle have 3 options of behaviour, depands on its location.
a. move to center.
b move randomly towards the center
c. (if not to close to screen edges) not move at all.
sometimes when the ball gets to its destination, it wanders a little next to its location.
2. when ball towards the paddle:
a. move the paddle center x according to ball center x.
b. strike the ball - hit the ball with paddles edges(which increase ball's speed)
c.missing the ball - try to place the paddle 2 pixels away from the ball's edges.
i tried to add delays between paddle decisions (with timer) but it makes the paddle looks more like a machine.
now my question for all those that kept reading that much... (sorry...) is there a better way to make the paddle's movement look "human" when i want the paddle to miss the ball?
Thanks!

Another thing you could do is have your AI paddle "overshoot" its estimation of where it should go. The way I'd do this still starts with my original way:
If the ball is to the left of the AI paddle, start moving the paddle left.
If the ball is to the left of the AI paddle, start moving the paddle right.
If the ball is directly below the AI paddle, stop moving the paddle.
But do this check less often. Instead of every time the ball moves (which is what I'm assuming you're doing now), do it every 10 moves, or 100, or whatever seems to work. You could even let the user set this number on a JSlider to adjust the difficulty.
By doing the check less often (but still moving the paddle), you'll have an AI paddle that moves the same speed as the player paddle and moves towards the paddle. But it will sometimes overshoot and have to readjust, just like a human player.
Let me know what you think.

Similar Messages

  • Anyone around here with an apple developer program membership who lives in the us and wants to participate in entering the atari  indie developer challenge for pong? I have the great idea required, ample coding skills and a completed game design document.

    If you have a membership with the apple developer community or know anyone who has and also resides within the united states, please contact.
    The purpose is to partake in http://www.atari.com/pongdeveloperchallenge
    The initial game design document is fully completed and the ideas expressed in it are more than strong enough to compete for the top prizes.
    I'm well versed in different programming languages (c, scheme, js, assembly, python,...) as well as being a proficient sound designer and musician and a skilled graphics and animation manipulator myself. Assistance with the actual development would appreciated but is not really necessary.
    Winnings and proceedings arising from participation would distributed most fairly. If you know anyone besides yourself that is able to help out, you would also be rewarded financially from an ensuing victory.
    Reply to this post, pm or send  a gmail to aelgoa
    Have a good one
    Marnix

    If you have a membership with the apple developer community or know anyone who has and also resides within the united states, please contact.
    The purpose is to partake in http://www.atari.com/pongdeveloperchallenge
    The initial game design document is fully completed and the ideas expressed in it are more than strong enough to compete for the top prizes.
    I'm well versed in different programming languages (c, scheme, js, assembly, python,...) as well as being a proficient sound designer and musician and a skilled graphics and animation manipulator myself. Assistance with the actual development would appreciated but is not really necessary.
    Winnings and proceedings arising from participation would distributed most fairly. If you know anyone besides yourself that is able to help out, you would also be rewarded financially from an ensuing victory.
    Reply to this post, pm or send  a gmail to aelgoa
    Have a good one
    Marnix

  • Page flipping with Volatile Image.  Need help :)

    Hello all,
    Could someone point me to a nice tutorial which specifically addresses setting up page flipping with Volatile Images as the buffer? I haven't had any trouble with the generic BufferStrategy way of doing things, but it looks like the absolute fastest way to go is page flipping. Any info on this subject would be appreciated. I am a student who is making his first attempt at setting up a fullscreen video game...well if you want to call it that! :) I am shooting for Pong as a first project!
    Please feel free to send me the info at [email protected], and thanks much.
    Kmyers

    If you're using Windows, then your picture is already most likely
    being stored as volatile. You should look for an article on the
    web discussing Java rendering internals as of 1.4 do a search for
    "java automatic images" you'll probably find some useful info.
    But if you insist you can just fire up a debugger and
    play with it until you finally figure out what it's doing..
    You just need to do a createVolatileImage as opposed to createImage
    when creating your buffers.. make sure to use
    createBufferStrategy(2) (or if you want to be totally sure print out
    the capabilities of the buffers available and select one that you
    know for sure supports back and front buffers that are "truly"
    volatile..
    it turns out in my experience on win2k that using normal "automatic"
    images via Component.createImage() are faster than volatiles perhaps
    because I tend to do alot of scaling ops which are not as of yet
    accelerated..
    here's some stuff that might help you:
    good luck!
    static public void printBufferCapabilities(BufferCapabilities bc) {
    System.out.println("Printing Buffer Capabilities: ");
    if (bc.isFullScreenRequired())
    System.out.println("Full screen is required");
    else
    System.out.println("Full screen is required");
    if (bc.isMultiBufferAvailable())
    System.out.println("MultiBuffering is available");
    else
    System.out.println("MultiBuffering is not available");
    if (bc.isPageFlipping())
    System.out.println("PageFlipping is available");
    else
    System.out.println("PageFlipping is not available");
    ImageCapabilities ic = bc.getBackBufferCapabilities();
    if (ic.isAccelerated())
    System.out.println("BackBuffer is accelerated");
    else
    System.out.println("BackBuffer is not accelerated");
    if (ic.isTrueVolatile())
    System.out.println("BackBuffer is truly volatile");
    else
    System.out.println("BackBuffer is not truly volatile");
    ic = bc.getFrontBufferCapabilities();
    if (ic.isAccelerated())
    System.out.println("FrontBuffer is accelerated");
    else
    System.out.println("FrontBuffer is not accelerated");
    if (ic.isTrueVolatile())
    System.out.println("FrontBuffer is truly volatile");
    else
    System.out.println("FrontBuffer is not truly volatile");
    static public void printImageCapabilities(ImageCapabilities ic) {
    System.out.println("Printing Image Capabilities: ");
    if (ic.isAccelerated())
    System.out.println("Image is accelerated");
    else
    System.out.println("Image is not accelerated");
    if (ic.isTrueVolatile())
    System.out.println("Image is truly volatile");
    else
    System.out.println("Image is not truly volatile");
    static public void printFlipContents(BufferCapabilities.FlipContents flip) {
    if (flip == null) { System.out.println("Dude your flip is flipping NULL!"); return; }
    if (flip.equals(BufferCapabilities.FlipContents.BACKGROUND))
    System.out.println("Flip Contents are BACKGROUND");
    else if (flip.equals(BufferCapabilities.FlipContents.COPIED))
    System.out.println("Flip Contents are COPIED");
    else if (flip.equals(BufferCapabilities.FlipContents.PRIOR))
    System.out.println("Flip Contents are PRIOR");
    else if (flip.equals(BufferCapabilities.FlipContents.UNDEFINED))
    System.out.println("Flip Contents are UNDEFINED");
    else System.out.println("Where the hell did you find this flipping Flip Contents, now flip off!");
    static public void printElapsedTime(String desc, long start, long stop ) {
    long s = stop - start;
    double elapsed = (double) s/1000;
    System.out.println("The elapsed time for "+desc+" :"+elapsed);
    public static void chooseBestDisplayMode(GraphicsDevice device) {
    DisplayMode best = getBestDisplayMode(device);
    if (best != null) {
    device.setDisplayMode(best);

  • How to make a really basic pong game for a beginner

    Hello.  I've read through a couple of threads on here dealing with making a game of pong in LabView, but in them the users had questions with far more complex aspects of the program than I want to deal with.  I am a beginner programmer in LabView with limited experience in Java and Visual Basic programming.  I was tasked with creating a game over winter break, and now that I finally have some time (this weekend that is), I decided that I'd make a really simple game of pong.  However, I have seriously overestimated the difficulty of this for a beginner who has very limited knowledge of Lab View.
    I ask you to please have some patience with me.
    I know what I want to do, and just need help inplementing it.
    Here is the idea for my design to keep it as simple as possible:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
    -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.  I want to take things slow.  So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    If I can at least get that far for now, then I can move on (with help I hope!) of inserting an interactive interface for the "paddle."
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    I thank you for any and all help anyone may be able to provide.

    EchoWolf wrote:
    -Create a field (I am not sure what to use for this, but from my reading it appears that some sort of a picture output is needed, but I cannot find that anywhere).
     Wel, there is the picture indicator in the picture palette. In newer versions it's called "2D picture". The palettes have a search function. Using the palette search function is a basic LabVIEW skill that you should know. If you've seen the example for the other discussion, it uses a 2D boolean array indicator. The boolean array is only recommended for a monochrome very low resolution display.
    EchoWolf wrote: -Set up some simple function that can output the dimensions of this field to use with collision tracking.
    -Create a ball that can be tracked by the program.
    That seems backwards. Properly programmed, the code always knows the dimension and the ball position. The program generates, (not tracks!) the ball movement. Of course you need to do some range checking on the ball position to see when it collides with the walls.
    EchoWolf wrote:
    -From my reading I understand that the simplest way to "bounce" the ball off the sides appears to simply reverse the X velocity of the ball when it strikes the vertical boundaries and the Y velocity when it strikes the horizontal boundaries.
    Of course you could make it more realistic by keeping track of three ball parameters: x, y, spin.
    EchoWolf wrote:
    -Insert some sort of a "paddle" that the user can control with the left and right arrow keys.
    Pong is typically played with the up-down arrow keys.
    EchoWolf wrote:
    Now, as I have mentioned I am a beginner with approximately one month maximum knowledge of this software, spread over about a year.
    LabVIEW knowledge is not measured in time units. What did you do during that month? Did you attend some lectures, study tutorials, wrote some programs?
    EchoWolf wrote:
    So for starters, would anyone be willing to walk me through creating a visual output for this and creating a ball that will bounce off all sides?
    I have found some LabView code for a simple game like this, but it also includes a score keeping loop as well as an "automatic play" option, and I am attempting to wade through all that code to find the bones of it to help me with this, but due to my inexperience, this might thake a lot of time.
    Start with the posted example and delete all the controls and indicators that you don't want, then surgically remove all code with broken wires.
    Alternatively, start from scratch: Create your playing field. Easiest would be a 2D classic boolean array that is all false. Use initialize array to make it once. Now use a loop to show the ball as a function of time.
    Start with a random ball position. to display it, turn one of the array elements true before wiring to the array indicator using replace array subset.
    Keep a shift register with xy positions and xy velocities and update the positions as a function of the velocities with each iteration of the loop. Do range checking and reverse the velocieis when a edge is encountered.
    What LabVIEW version do you have?
    LabVIEW Champion . Do more with less code and in less time .

  • What do i need for a classic pong game with real-life interface/ speedy-33?

    Lo guys, i'm a student, for my academic project i was kinda hoping to do a classic pong game with LabVIEW... 2 Palettes, a ball... except the goal is to involve the "outside world in this poject". So i was thinking of moving the palletes when a player's finger is moved (i guess i need a sensor, was thinking of placing a bright color on each finger so as to be detected). Note that i would be using speedy-33
    please guys i am very new to labview, and i need a project, i got one but i still dunno how to produce it... Thank you all
    Best regards.
    T. A.

    This should give you a good start. We did this as a wait window when we were updating software. It is old code so I do not want any comments on the coding style. It was done in fun and has not been updated in almost ten years.
    You will have to update the controls to work from a control vs automatically. Have fun let me know how this turns out.
    Tim
    Johnson Controls
    Holland Michigan
    Attachments:
    Update Software.vi ‏10 KB
    PONG.vi ‏55 KB

  • Code for a pong game written in C++

    Hi there
    I have this computer graphics project, to implement a pong game written C++, using openGL. I have never done such a project before and I'm not keen to C++. Thus, if anyone have the code of a pong game written in C++, please don't hesitate to help me...
    Thankx in advance

    Why not create a DLL?  It doesn't have to be in C -- I was using one done in C# today and have also used DLL's written in C++.  If you can make it into a DLL, LabVIEW can call it (although there are certain details like pointers and structures that have to be taken care of.
    If you want to use a CIN, keep in mind that just about everything you pass back will have to be done with a file....
    -Matt Bradley
    ************ kudos always appreciated, but only when deserved **************************

  • Is it time yet for Microsoft to "Recall" Office 2013 and provide anyone who has a 2013 license a replacement Office 2010 license?

    The interface is terrible and can't be changed.  Every application in the suite locks up/crashes nearly constantly on any machine it is used on.  The activation process is terrible and wastes hours of any support/IT dept's time.  From a 'privacy
    standpoint', the software is seemingly criminally intrusive.  It is clearly a product that should never have been released and is so far from functional that it can't be repaired by any 'service pack', 'hotfix', or 'patch'.  It needs to be completely
    scrapped.
    The only 'redeeming quality' of this software is that the guy who was in charge of creating it is gone from Microsoft.  (Unfortunately, he is now President Obama's appointee for running the attempt at repairing the 'healthcare.gov' website... 
    out of the frying pan...   )
    When the software is installed using one profile (domain or machine account) and a different profile tries to use the software, it requires 're-activation' - which often fails because the software believes it has been installed multiple times. (This is particularly
    frustrating because it has to be installed by an administrative user, but most of the time, the person who 'uses' the software is not the 'administrator' - so it is almost always being 'installed' using one profile and 'used' using another profile).
    The necessary intrusion into privacy created by the requirement of a "Microsoft Account" to use the software is seemingly criminal.
    The tracking of, and installation of licenses is absolutely ridiculous. 
    An example: 
    Many of my clients have many users and many computers (up to 75 or so). 
    I could create a "Microsoft User Account" for each 'user', but these machines get moved between users, and the software license is tied to the 'machine' and not to the 'user' so as soon as that happens, the licenses and the users are no longer
    in line and become impossible to track.
    I could create a "Microsoft User Account" for each 'computer'... and I can't even count the ways this would be a nightmare to try to track.
    I actually did that up front for one client, and created Exchange email boxes for each computer so that "prove you are really you" emails from Microsoft could be received managed, and responded to, and passed out second usernames and passwords
    to all of the users so they could "log-in" to their Office 2013 software, and created a database of the 'computer usernames and passwords' so I could track this... unfortunately, this confused the users (as it rightfully should) so they would change
    the passwords for their computer's 'Microsoft User Account' thus locking me out and invalidating my database, ... and... CLUSTERF#%K!!!
    As a 'best - worst case', I have had to create a single 'Microsoft User Account" for each of my clients' businesses so I can install and activate Office 2013 products.  This is a whole new set of "Awesome Stupidity". 
    Now, I can put a new computer into a client's office and install their new license key for their oem Office 2013, and it shows up in the 'business's Microsoft User Account'.  Then when I give the machine to the user, I get to 're-activate' the software
    (hoping that it doesn't tell me to piss-off - which happens about 40% of the time.  This is a process that can only be described as a "feat of engineering created by a group of monkeys whose former jobs included 'janitor at MAD magazine headquarters'
    or 'beer-pong referee'). 
    It starts with two hours of pressing phone buttons and ultimately talking to someone who tells me "yeah, nothin' I can do about that I'm just here for product activation" (which, incidentally, is done by machine until you pass through MS's ridiculous
    labyrinth of repetitious keystroking until the machine is convinced you are just too stupid to punch in the right numbers and allows you to talk to a person... who then asks you for the exact same set of numbers and repeats back the exact same responding set
    of numbers and acts dumbfounded when it still doesn't work - since it didn't work the first six times you punched or said it into the phone) followed by "I need to send you to the support group... but because it's 6:30 pm (in a process you started at
    3:00pm) they are gone for the day and you'll have to call back on Monday morning"
    At some point in the process, you get to log into the "Microsoft user account" and 'roll the roulette wheel of stupidity' by trying to activate the right software from a list of 40 different lines that all say "Microsoft Office 2013 Home and
    Business oem", but none give any indicator or differentiating factor like for instance: license key, date installed, license key last 4 digits, mother's maiden name, phase of moon when software was first activated, color or type of blood of the user's
    paperboy's dog's previous owner... NOTHING... RANDOM FREAKING STAB IN THE DARK - pick one, any one, hope its the license you are trying to install onto this machine, 'cause if not, you very well may kill the product on some other machine.
    So through the process, the lucky support staff person gets' to waste roughly an hour and a half on average for every Microsoft Office 2013 installation.  I have actually had to start telling my clients that they are going to likely have to pay an extra
    $100 or so per machine in order to get their new Microsoft Office software which comes on their new computer activated - that number tends to work out roughly accurately - except that it is a terrible way of trying to 'please a client'.
    Oh,... and did I mention... "THE SOFTWARE CONSISTANTLY FAILS"!?! 
    A client tries to open a document that they have been using for 8 years and Excel doesn't say "Hey, I don't know how to deal with some element of the file that you put in here using Excel 2003, or Office 2010 (both products, by the way, which worked
    great) - no... instead,... it crashes.  Doesn't really do any damage to the file it choked on, but the work you'd been doing on three other files which you also had open,... yeah,... that work is gone.
    Yeah,.... over time, I have developed a pretty consistent spiel for client's needing new computers that goes over how absolutely terrible Office 2013 is, and explains that our options are further limited by Microsoft's yanking of all Office 2010 or previous
    products from market availability, and explaining the merits of both LibreOffice and OpenOffice, as well as their drawbacks.  I also have a strangely static response explaining how "larger companies are not burdened by these issues because they are
    able to use MOPL which allows them to downgrade their productivity software to Office 2010 so they can continue to function happily, but this is really not a cost effective solution for smaller companies who primarily buy oem Office products with their replacement
    computers".
    Unfortunately, many clients still decide they want to go with Office 2013 because they apparently believe "it really can't be that bad".  The value in my 'presale descriptions' are only really realized when they come back to me a week, two
    weeks, or up to a month after the new machine is in place and say "wow,... you were right".  The place I am left open for any further problems is when I don't impress upon them beforehand just HOW BAD OFFICE 2013 REALLY IS.  In that case,
    they still come back to me as though I have done something wrong foe selling them this piece of $#!% software and I have to remind them of our previous discussions.
    Strangely, far too few heed the warnings and buy the software anyway - but the discussion has saved many clients the costs of Microsoft Project, because the discussion of LibreOffice and OpenOffice nearly always leads to at least a small philosophical conversation
    about 'Open Source Software' in general, and my absolute favorite descriptive analogy in that discussion is to compare Microsoft Project at $600 v. ProjectLibre at $0 - and then further describe the costs of licensing and implementing the associated back-end
    server solutions, etc. 
    This is a saving grace for me, because even though the client has been saddled with Office 2013, they have also saved substantially on Project and it is a rare (but granted, not absolutely absent) occasion that ProjectLibre is lacking some feature or function
    that they actually need or want to use - and on those occasions, finding out has cost them absolutely nothing in software purchases. 
    Its not surprising, I suppose, that clients have grown to accept Office as a required 'cost', but still choke heavily on the price-tag of Project every time they have to buy it.  The interesting thing to watch over the coming couple of years will be
    'how many businesses stop accepting MS Office as a 'required cost' due to the failing of the software itself and the fact that most are being burned, at least once, by purchasing the software "against technical advice" and are learning, merely by
    virtue of HOW BAD Office is, that there are other options out there that both cost less and work better... I mean,... LOTS BETTER.
    How many businesses that are used to accepting the cost of Microsoft Office as a cost of doing business will be moved over to open source options and satisfied by them by the time Microsoft releases its next version - which will, presumably work - such that
    they will no longer justify the cost of Microsoft's offering even if it is 'superior' to the open source offerings because the open source offerings are plenty sufficient and include a price tag of $0 and an installation/implementation time that is much, much
    shorter than Microsoft's offering.
    If Microsoft doesn't make some dramatic reparations, and do it soon, I expect their market share will be reduced in this area by a very significant margin.
    I am suggesting either a 'Complete Recall' of Office 2013 including an 'uninstall 2013/install 2010' process driven by the automatic update engine, or at the very least, a free and easy downgrade rights offering for anybody who has already purchased 2013
    and anyone who purchases it between now and the time the next "functional product" is released.

    I understand the inconvenience you are experiencing when working with Office 2013.
    If you have any feedback about Office 2013 product, click the and submit to Microsoft.
    Microsoft will decide how to fix the problem for all customers.
    For the activation mechanism, it intends to protect customers of their rights and interests.
    For a retail version of Office, if it was purchased with a disk, Microsoft account is not necessary during the installation.
    For volume license of Office, refer to the following link to deploy Office suites can be much efficient:
    http://technet.microsoft.com/en-us/library/cc178982.aspx
    For the problem Office 2013 keep crashing, check the following link to check:
    http://support.microsoft.com/kb/2813143/en-us
    http://support.microsoft.com/kb/2758592/en-us
    Thanks,
    Tyor Wang
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no
    help.
    If you have any feedback on our support, please click
    here

  • Please help beginner! Few pong questions.

    So, I have just started creating my own pong game after
    learning the basics of Flash 8. Everything went perfectly until
    now, I got a bit stuck.
    I got to point where I have fully working menu, multiplayer
    and singleplayer, you can play against another person using mouse
    and arrows. The scoring system works too and I actually managed to
    get the computer to follow the ball but here comes the first
    problem. I found a whole actionscript for the ball on the internet
    here it is:
    onClipEvent(load){
    s = {l:10,r:490,t:20,b:405,w:10,h:10};
    function setSpeed(){
    xspeed = Math.round(Math.random()*5)+1;
    yspeed = Math.round(Math.random()*5)+1;
    xspeed *= Math.round(Math.random()*2)==1 ? -1 : 1;
    yspeed *= Math.round(Math.random()*2)==1 ? -1 : 1;
    setSpeed();
    _root.cscore = _root.pscore = 0;
    onClipEvent(enterFrame){
    _x += xspeed;
    _y += yspeed;
    if(_x+(s.w/2)+xspeed>s.r){
    _x = s.r/2;
    _y = s.b/2;
    setSpeed();
    _root.cscore += 1;
    if(_x-(s.w/2)+xspeed<s.l){
    _x = s.r/2;
    _y = s.b/2;
    setSpeed();
    _root.pscore += 1;
    if(_y+(s.h/2)+yspeed>s.b){
    _y = s.b-(s.h/2);
    yspeed *= -1;
    if(_y-(s.h/2)+yspeed<s.t){
    _y = s.t+(s.h/2);
    yspeed *= -1;
    if(this.hitTest(_root.player)){
    _x = _root.player._x - _root.player._width/2;
    xspeed *= -1;
    xspeed *= 1.08;
    yspeed *= 1.08;
    if(this.hitTest(_root.computer)){
    _x = _root.computer._x + _root.computer._width/2;
    xspeed *= -1;
    xspeed *= 1.08;
    yspeed *= 1.08;
    As I said I am a beginner and I dont really understand the
    code. The problem is that after every hit the ball gets faster and
    faster and faster until it is impossible to see it.
    Here comes another problem: I have got the enemy just
    following the ball so it is impossible to score the script for
    enemy is:
    onClipEvent(enterFrame){
    ydist = _root.ball._y - _y;
    _y = _root.ball._y;
    Now my question is can someone plese tell me what do I have
    to change in the ball code so it stays at the constant speed or it
    just increases a little bit. The second qustion is how can I make
    the enemy computer not perfect? So you can actually win the game?
    Something like hit it randomly.
    My last question is: The game should be quiz pong. So if you
    score a point a qustion will pop up and you will have to answer it.
    What is the best way to do that? I think it should mean somethin
    like this: If score=+1 gotoandplay(lets say the question will be at
    frame 20) I dont know if that is the way it should be formed in the
    action script it is just my guess.
    Please if someone can help me at least with one of those
    questions I would be incredibly oblidged. thanks

    hey, im not great at this easier, but i think the speed
    problem can be solved by getting rid of the 2 lines
    xspeed *= 1.08;
    yspeed *= 1.08;
    I think this increases the speed by 8% after every hit. You
    can also try lowering the number, but if you go elow 1 it will slow
    down.

  • Windows Could not find the Driver for your Apple iPod USB Device (5G 30GB)

    I have a 8GB iPod Nano. My roommate has a 30GB 5G Video. Black.
    My iPod syncs flawlessly. His is not recognized by Windows or iTunes. Every time we plug in the iPod, it prompts us for the driver. I tried to install the update apple mentions through the windows process, but after going through the tedious Windows Genuine Verification process, I was told that the update didn't apply to my computer.
    We use a Lenovo Thinkpad T60p, which shipped with Windows Vista Business.
    We are running iTunes 7.3.1.3, and there are no windows updates available for the computer.
    I have...
    ...reset
    ...reinstalled 7.3.1.3 (over and over and over)
    ...tried different USB ports. (Early on, we saw it once after swapping ports).
    ...tried turning off the ability of the computer to 'Turn this device off to save power."
    I have also verified that the iPod works on my work Dell Lattitude D620 running XP, and that it's not the cord, as we've used the cord that came with my Nano as well.
    So, the problem seems to be with vista, as many people seem to have had. The best thread I found that deals with this was http://discussions.apple.com/thread.jspa?threadID=995793.
    But even after having tried everything, I still have an unrecognizable iPod.
    When I run iPod diagonostics, everything seems okay, except for the iPod connection, which says failed. I've had difficulty working with the iPod service under Computer/Device Manager - it doesn't ever seem to stop or start, with the iPod plugged in or not.
    And interestingly enough, the FAT32 external harddrive that I use to back up my data exhibits exactly the same problem ("Windows could not find the driver for your USB Mass Storage Device). This device worked great in XP, and even odder, I have a FAT32 partition of the main HD as a swap space between my VistaOS and my Ubuntu installation.
    Do I have to chalk this up to another issue with Windows Vista? What bothers me there is that you're a ping-pong between windows support and apple support - no one really owns up the problem.

    Bill, I've been stuck in this loop for 3 months since buying a new laptop with Vista Basic. I've tried everything to no avail. I don't know what else to do apart from buying a cheap PC running XP. Let me know if you manage to find a solution and I'll do the same.
    Regards. Adam

  • What would be a good way for me to practice Java...?

    I have all the basics down. I can make text games decently well. I made a Pong game, and I followed a "do it yourself" tutorial that explains what needs to be done, but has you do it.
    What should I do to further my Java skills? I'm not sure where to go from here. Networking seems too advanced. I don't feel too great at graphics either.
    Any suggestions and pointers?
    Thanks for any help.

    I was just wondering if it was too advanced for someone of my level.Might be. I don't know your level.
    But I'll give it a shot.Great.
    Do you know of any good articles or tutorials on
    relational databases? I've found some on Google, but
    I'm not too sure of their quality...If you don't know anything, what difference does it make? Try a few and see how they go.
    A good place to start might be the Sun JDBC tutorial. It won't teach you much about databases, but it has the virtue of being simple. Google for it.
    %

  • Pong Game Problem

    I have a problem with my pong game. IT says its missing a return statement at :71: and at someplace else. How do I fix this? Below is the source code. Note that I haven't done puck-paddle collisions yet. It isn't supposed to do those right now anyway, so please try to fix the return statement problem, not that. Here is the code:
    import java.applet.*;
    import java.awt.*;
    public class Ponggame extends Applet implements Runnable
         int score = 0;
         int otherscore = 0;
         int y_speed = 0;
         int other_y_speed = 0;
         int appletsize_x = 640;
         int appletsize_y = 480;     
         int xpos = 620;
         int ypos = 220;
         int otherxpos = 20;
         int otherypos = 220;
         int ball_xpos = 130;
         int ball_ypos = 130;
         int radius = 20;
         int ball_xspeed = 2;
         int ball_yspeed = 2;
         int paddle_width = 32;
         int paddle_height = 80;
         int other_paddle_width = 32;
         int other_paddle_height = 32;
         //Variables for Double Buffering
         private Image dbImage;
         private Graphics dbg;
         public void init()
              setBackground (Color.black);
         public void start()
              Thread th = new Thread (this);
              th.start ();
         public void stop()
         public void destroy()
         public boolean keyDown (Event e, int key)
              if (key == Event.UP)
                   y_speed = -2;
              else if (key == Event.DOWN)
                   y_speed = 2;
              else if (key == 119)
                   other_y_speed = -2;
              else if (key == 115)
                   other_y_speed = 2;
         public boolean keyUp (Event e, int key)
              if (key == Event.UP)
                   y_speed = 0;
              else if (key == Event.DOWN)
                   y_speed = 0;
              if (key == 119)
                   other_y_speed = 0;
              else if (key == 115)
                   other_y_speed = 0;
         public void run()
              Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
              while (true)
                   if (ball_xpos > appletsize_x - radius)
                        otherscore += 1;
                        ball_xpos = 120;
                        ball_ypos = 120;
                   else if (ball_xpos < radius)
                        score += 1;
                        ball_xpos = 120;
                        ball_ypos = 120;     
                   else if (ball_ypos > appletsize_y - radius)
                        y_speed = -2;
                   else if (ball_ypos < radius)
                        ball_yspeed = +2;
                   else if (ypos<0)
                        ypos = 0;
                   else if (ypos+paddle_height>appletsize_y)
                        ypos = (appletsize_y - paddle_height);
                   else if (otherypos<0)
                        otherypos=0;
                   else if (otherypos+other_paddle_height>appletsize_y)
                        otherypos = (appletsize_y - other_paddle_height);
                   ypos += y_speed;
                   otherypos += other_y_speed;
                   ball_xpos += ball_xspeed;
                   ball_ypos += ball_yspeed;
                   // Neuzeichnen des Applets
                   repaint();
                   Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
         public void update (Graphics g)
              if (dbImage == null)
                   dbImage = createImage (this.getSize().width, this.getSize().height);
                   dbg = dbImage.getGraphics ();
              dbg.setColor (getBackground ());
              dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
              dbg.setColor (getForeground());
              paint (dbg);
              g.drawImage (dbImage, 0, 0, this);
         public void paint (Graphics g)
              g.setColor (Color.red);
              g.fillOval (ball_xpos - radius, ball_ypos - radius, 2 * radius, 2 * radius);
              g.setColor (Color.white);
              g.fillRect (xpos, ypos, paddle_width, paddle_height);
              g.fillRect (otherxpos, otherypos, other_paddle_width, other_paddle_height);
    }

    Your public boolean keyXXX methods don't return a boolean.
    And use code tags when posting code. There is a code button above the message editor.

  • I am trying to get the artwork for an album. "Artwork Not Modifiable" appears in the artwork box and it doesn't let me drag artwork.  What can I do to fix this?

    I am trying to get the artwork for an album. "Artwork Not Modifiable" appears in the artwork box and it doesn't let me drag artwork.  What can I do to fix this?

    Words simply can't describe what a kludge iTunes has become.  Every time Apple fixes one problem, a dozen more pop up.  It's like trying to hold a bunch of ping-pong balls under water simultaneously.
    The immediate problem is that Lion with iTunes buggers the artwork.  Some it loses, some it can't find, and some appears and disappears like the Flying Dutchman (look it up...).
    The bigger issue is that so MUCH of iTunes is bad, in general.  Apple trys to use iTunes as a Swiss Army knife, using it to synch iPhones, iPads, etc.  The app has become so generic that it is actually good at nothing.
    The interfrace is kludgy; moving the library from one location to another virtually guarantees a wasted day and usually lost art, music, or backups.
    In general, Apple's hardware and software is relatively ergonomically designed.  I-Tunes, however just plain SUUUUUUUUUUUUCKS!

  • Java And Flash For Safari

    *Hey I have Safari and in most of the websites I see blue boxes with question mark on it. Can someone please post a link for downloading a plug-in that will fix it. IE7 doesnt have this problems..*

    Here's an example: http://www.miniclip.com.
    The site uses Shockwave plug-in, not Flash plug-in. Unfortunately the Apple's plugin page doesn't list this plug-in. You can download it from this site: http://www.adobe.com/shockwave/download/download.cgi?P1Prod_Version=ShockwaveFull&P2_Platform=Win32&P3_BrowserVersion=Netscape6
    After installing above Shockwave Player plug-in many games start working. However some of them like Crazy Karts or Creepy Pong hangs Safari browser. I will report this bug to Apple's bug tracking system.
    another thing..is real-player's download video from every site feature compatible with Safari (Real Player 11)
    An example address?

  • Help on simple two player Pong!!

    I am fairly new to java. But I know quit a bit already. I want my to write a program that is just pong and has two paddles. One player controls one and the second player controls the other. Can anyone help me with it here is my code: ( I have tryed a switch statement for handling the keyboard but it doesn't work can anyone help me?)
    import java.awt.*;
    public class Pong extends java.applet.Applet
              int x = 245;
              int y = 145;
              int xVelocity = 3;
              int yVelocity = 3;
              int playerOneY = 105;
              int playerOneY2 = 110;
              int playerTwoY = 105;
              int playerTwoY2 = 110;
              Color ballColor = new Color(25, 120, 190);
              Color panelColor = new Color(220, 35, 70);
         public void paint(Graphics g)
                   while(true)
                   g.setColor(panelColor);
                   g.fillRect(0,playerOneY,5,playerOneY2);
                   g.fillRect(495,playerTwoY,500,playerTwoY2);     
                   g.setColor(Color.lightGray);
                   g.fillRect(0,305,510,310);
                   g.fillRect(0,0,510,5);
                   g.setColor(Color.white);
                   g.fillOval(x,y,25,25);
                   x += xVelocity;
                   y += yVelocity;
                   g.setColor(ballColor);
                   g.fillOval(x,y,25,25);
                   // bounces off paddles
                   if((y < playerOneY) && (y > playerOneY2))
                        if(x<0)
                             xVelocity = +xVelocity;     
                   if((y < playerTwoY) && (y > playerTwoY2))
                        if(x>500)
                             xVelocity = -xVelocity;
                   //bounce off top walls
                   if((y > 285) || (y < 25))
                        yVelocity = -yVelocity;     
                   if((y < 0) || (y > 285))
                        yVelocity = +yVelocity;
                   g.setColor(ballColor);
                   g.fillOval(x,y,25,25);
                   for(int i=0; i<20000000; i++);
                   repaint();
    }

    Heres soem suggestions.... To to keyboard interaction, you need to import java.awt.event.*
    then have your class implement KeyListener or use a KeyAdapter , then addKeyListener(this) in the constructor or else where, then implement each of the key event methods, but just use the keyPressed(KeyEvent e) method, then in that, get the key code, like this:
    public void keyPressed(KeyEvent e)
            int key = e.getKeyCode() //gets the code of the key pressed
             switch(key)
                     case KeyEvent.VK_LEFT: blahblah();  break;
    }

  • Setting up SAP Router for SNC ... error...

    Hi,
    My SAP Router is installed on a server that is Linux based. (IP address is 10.11.0.24)
    I'm not sure if is saprouttab or saprouter itself having issue.
    I started the saprouter via this command: saprouter -r -G routerlog -W 60000 -S 3299 -K "p:CN=XXXXXXXX, OU=ZZZZZZZZZZ, OU=SAProuter, O=SAP, C=DE"
    saprouttab
    # SNC connection to and from SAP
    KT "p:CN=sapserv9, OU=SAProuter, O=SAP, C=DE" 169.145.197.110 *
    KT "p:CN=sapserv9, OU=SAProuter, O=SAP, C=DE" 10.11.0.24 3200
    # SNC connection to local system for R/3-Support for support
    KP "p:CN=sapserv9, OU=SAProuter, O=SAP, C=DE" 10.11.0.24 3200
    KP "p:CN=sapserv9, OU=SAProuter, O=SAP, C=DE" 10.11.0.24 3201
    KP "p:CN=sapserv9, OU=SAProuter, O=SAP, C=DE" 10.11.0.23 3200
    # Access from local network to SAPNet (OSS)
    P 10.11.0.* 169.145.197.110 3299
    P * 10.11.0.* * *
    # deny all other connections
    D * * *
    Troubleshooting steps taken:
    Running niping -s on SAP Router Server & niping.exe -c -H 10.11.0.24 is successful, self-test is okay but... when running both niping -s & saprouter -r on SAP Router Server is giving me the following error:
    C:\test>niping.exe -c -S 3299 -H 10.11.0.24
    Wed Feb 05 14:51:29 2014
    connect to server o.k.
    Wed Feb 05 14:51:30 2014
    *** ERROR => NiBufIProcMsg: hdl 1 received rc=-93 (NIEROUT_INTERN) from peer [nibuf.cpp    2146]
    *** ERROR => NiTClientLoop: NiTReadLoop (rc=-93) [nixxtst.cpp  2590]
    *  LOCATION    SAProuter 40.4 on 'XXXXXXXX'
    *  ERROR       internal error
    *  TIME        Wed Feb  5 14:51:29 2014
    *  RELEASE     720
    *  COMPONENT   NI (network interface)
    *  VERSION     40
    *  RC          -93
    *  MODULE      nirout.cpp
    *  LINE        2698
    *  DETAIL      NiRClientHandle: route expected
    *  COUNTER     2
    C:\Users\tohcy\Desktop\test>niping.exe -c -S 3299 -H /H/10.11.0.24/H/10.11.0.24
    Wed Feb 05 15:01:00 2014
    *** ERROR => NiBufIProcMsg: hdl 1 received rc=-94 (NIEROUT_PERM_DENIED) from peer [nibuf.cpp    2146]
    *** ERROR => NiBufIConnect: route connect for non-buffered hdl 1 failed (rc=-94;/H/10.11.0.24/H/10.11.0.24); pong not received [nibuf.cpp    4801]
    *** ERROR => NiTClientLoop: NiHandle (rc=-94) [nixxtst.cpp  2590]
    *  LOCATION    SAProuter 40.4 on 'XXXXXXXX'
    *  ERROR       XXXXXXXX: route permission denied (YYY to 10.11.0.24, 3299)
    *  TIME        Wed Feb  5 15:00:59 2014
    *  RELEASE     720
    *  COMPONENT   NI (network interface)
    *  VERSION     40
    *  RC          -94
    *  COUNTER     7

    Hi Deepak,
    I've changed to the P * * *
    I run the command: niping.exe -c -S 3299 -H /H/10.11.0.24/H/10.11.0.23
    Can I check if this command is correct?
    Router is 10.11.0.24 trying to reach sap server 10.11.0.23.
    Error:
    Thu Feb 06 09:20:17 2014
    *** ERROR => NiBufIProcMsg: hdl 1 received rc=-5 (NIETIMEOUT) from peer [nibuf.cpp    2146]
    NiBufIConnect: route connect of non-buffered hdl 1 to '/H/10.11.0.24/H/10.11.0.23' timeout
    *** ERROR => NiTClientLoop: NiHandle (rc=-5) [nixxtst.cpp  2590]
    *  ERROR       timeout occured
    *  TIME        Thu Feb 06 09:20:17 2014
    *  RELEASE     720
    *  COMPONENT   NI (network interface)
    *  VERSION     40
    *  RC          -5
    *  MODULE      nibuf.cpp
    *  LINE        4795
    *  DETAIL      NiBufIConnect: route connect '/H/10.11.0.24/H/10.11.0.23'
    *              timeout
    *  COUNTER     1
    routerlog:
    Thu Feb  6 09:27:21 2014 CONNECT FROM C19/- host 10.11.0.181/50107
    Thu Feb  6 09:27:21 2014 CONNECT TO   S19/12 host 10.11.0.23/3299
    Thu Feb  6 09:28:21 2014 CONNECT ERR  S19/12 could not establish connection within 60s
    Thu Feb  6 09:28:21 2014 DISCONNECT   S19/12 host 10.11.0.23/3299
    10.11.0.181 is my computer current IP address.
    Any other clues/hint?

Maybe you are looking for

  • ITunes help with syncing; many error messages, Help please!

    So, I have downloaded and re-downloaded the new iTunes 10.7 about a thousand times. Everytime I try to download, I get the message "rolling back" and then it starts up again and continues to download. Once downloaded, I plug my iPod touch 4th generat

  • Can i download multiple copies of mountain lion to my other mac's?

    I purchsed a copy of Mountain lion from the app store and downloaded it to my laptop.  my son purchased a copy of it and downloaded it to his laptop...it made me think that maybe....just maybe i don't have to purchase 3 other copies for each of our f

  • File Soap Rfc

    In my scnario file soap rfc i have used BPM.Even though the file is not picking up & its not calling webservices.Basically my requirement is i need to send a file which has to call webservice and the response has to get back to rfc.i am tring to work

  • Withholding tax base amount

    Hi, I have 2 withholding taxes for a vendor but I only want one of them to be picked up for related transaction. But I encounter is, the system calculate withholding tax for both taxes. Please advice how can I choose one of them for a transaction. Th

  • Don't know how to fix this - status says no internet connection, yet I'm on the internet.

    So this is a weird one. I got this new MacBook Air and the WiFi started up without a hitch.  I had finished migrating from my old computer to my new one and all of a sudden the status bar signal went from full bars to an exclamation point.  The info