Plz help me in my game

I have just started programming java and here is a game i have made so far:
http://www.freewebs.com/blobber/KillersJar.html
-Keys-
Player1
Up: Up arrow
Down: Down arrow
Left: Left arrow
Right: Right arrow
Player2
Up: W
Down: S
Left: A
Right: D
Now my question: Could someone of you tell me how i can make the players rotate left when i press left and then if i would rotate the player lets say 45 degrees and then walk forward it would go diagonal. Now the players just go up, down, left, right. Thanks in advance

Is vector calculations same as geometry?vector calculations are based on geometry or i should say trigonometry wich is based upon geometry. Everything is done through relationships between sides of right triangles. cos = adjasent/hypontinus sin = oposite/hypotinus tan = o/a or cos/sin
I just had sin, cos, tan functions in school but we
just counted different sides in triangles. Do u use
those functions to count how much x and y the sprite
moves when you press forward if its turned, lets say
67 degrees? basically we look at the hypotinus of the right triangle and call it 1 units. This is implemented when radian measurements are used. To get the x distance we take the cos of the included angle (between the hypotinus and the adjasent side), the y distance is the sin of the included angle once again.
If you have continuous movement (not just for each key press) you need to apply a speed to the components and you get a vector--which is a speed in a direction and you get the individual components of the vector (x,y) by using the previously discussed formulas.
In that case i really don't know how to
count that. Could u plz show me how u do it, then i
maybe might understand. I'm good at maths but I'm
only 15 years so i don't think i understand if u
don't show me.
Yes my game would have overhead view what code must
you write to rotate the sprite (even if i don't learn
how to have free movement i can still use that so i
don't have to make seperate frames for
up,down,left,right).look up the affine transforms and see if they will do what you need, i believe that is how Java does image rotation.
Then one last thing, how have u
learned all the different methods u can use in java.
Is there a good internet site somewhere with a list
of em all?The best way I have found is to go though the Java Tutorials and other instructions here on Sun's site... it is very good and once you have done that, take a look for books that will specifically enhaunce your understanding of specific interests.
Have fun, if you have any further questions feel free to e-mail me or post here.

Similar Messages

  • Plz help me in developing games.

    Hi,
    Though im familiar with java programming but developing java games is a nightmare for me. I dont have any industrial experience but im a student. i have been give an assignment to design and implement a simple game called concentration. Concentration is traditionally played with a deck of cards that have pairs of symbols that the players match up. Can anybody suggest any good sites for this.
    Please help me and thanks in advance
    rita

    Have you even tried?

  • Plz help with snake-like game..

    hi.
    i am new to java and want to programm a kind of worm-game where there are multiple worms, each different color and when your worm (you can choose your direction by pressing left and right button) crashes in something, that isnt the clear background (worms or the border rectangle) then it should stop. so my problem is:
    how can I get the program to know, that the worm has crashed into something?
    i think the easiest solution would be, if I could determine the Color of a specific Pixel on the canvas (i am using a canvas for the playfield).
    or another solution could be that if i could determine, wheter the Pixel is an element of the worm or the rectangle (dont think this is possible).
    somebody wrote in an earlier question that i should use the buffered image class. im currently trying to do so.
    another big problem is, that it has to be very fast. its a problem that i have to, in order to show the animation, repaint the canvas every 30 milisecs or so (im using a thread). is there a possibility to only redraw the worms? (im using g2d lines as "worms", that are beeing added every animation another line)
    THX VERY MUCH FOR HELPING!!

    First of all, thx for trying to help!
    well.. its a different kind of snake game: the starting point of the snake always stays the same. this means, that the snake grows longer and longer, without the butt moving behind the snake, but staying in the same position.
    so, if i'd try to put all those lines into an array (every line of the snake is very small, it is been added every 30 millisecs another line) this array would explode, and this would not be a very fast or elegant solution. so i think it must be possible to read the Color of a single pixel, the pixel, where the snake moves next... so that if the color would be other than the background color, it should stop, because the snake must have been crashed into something.
    so.. i posted this into an earlier thread and somebody said the class BufferedImage and its method getRGB() should help. im currently trying to do so, but it doesnt work.
    i cant seem to get the data from the JPanel (where i am drawing the snakes (i think thats the problem)) into the bufferedimage.. anyone could help, please?
    here is some code from the game:
    CODE
    BufferedImage bi = new BufferedImage(505,505,BufferedImage.TYPE_INT_RGB);
    CurrentBackgroundRGB = bi.getRGB((int)(Worm1.xStart+Worm1.x),(int)(Worm1.yStart+Worm1.y));
    if(HintergrundRGB != BackgroundCol.getRGB())this.interrupt();
    end CODE
    "this" is the current thread of the animation
    I think the problem is obvious: how can i get the Buffered image to check the data from my JPanel?

  • J2Me game programming plz help

    Helo everyone,
    I am working in j2me game programming plz if
    any one know how make image as small as possible
    in our game program.?
    I am using *.png format of image which is working well
    in game but my game size is very big so plz help me to get
    out of this problem
    Thank u
    Aman Gautam

    I solved the same problem by using indexed color images instead of true color.
    So, for example, if you have a colorful background you can convert it to a 256 color image.
    Depending on your specific image and the devices you'll see it on you may or may not notice the difference, but the file size is generally smaller.
    Then you can push further for smaller elements, like, say, a moving object like a pointer or a starship, you can reduce it to 60 or 30 colors, or even less.
    Another technique is to use tiles to build up the background instead of big images. With MIDP2.0 there's the TiledLayer, but you can implement the same with some code also on MIDP1.0 if backward compatibility is of concern.

  • I have downloaded a game called temple run, it is stuck downloading under the game it sayz 'Waiting' i have 3 other apps like that and my Smurfs game updating it is stuck too like that ! I have alot of apps so i dont want to delete date!!!! Plz help!!!!

    I have 4 apps that i just downloaded and they are 'Waiting' i need some one
    To plz come up with a solution i dont want to erase my data cause i have over
    100 games paid and free PLZ HELP i also have my smurfs game updating
    And i cant get on it now cause
    It wont update plz help!!!!!!!

    These links might be of help:
    Troubleshooting applications purchased from the App Store
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    iPod touch: Hardware troubleshooting
    I would use these links in order { if the info on first link doesn't work, move to second link }

  • I keep on getting asked to put account details i do but it declines the details but then when i want to download a free game i still have to put my bank details plz help me been like this for around 8 months : please help

    I keep on getting asked to put account details i do but it declines the details but then when i want to download a free game i still have to put my bank details plz help me been like this for around 8 months :< please help

    Hi.
    I'm not sure of it's still possible to choose 'None' under payment method. Besides, I'm sure you would like to be able to buy paid Apps as well.
    Try edit your payment information from a PC/Mac instead of your phone.
    Open iTunes > Choose 'iTunes Store' > Upper right corner, select your account or 'Sign in' > (When signed in) Click your account and go to 'Settings'.
    Make sure your credit card qualify for use in the Apple Store.
    Best regards.

  • Plz help me,after instuling the last software update,the programs and games and everything i have download it can't open!

    plz help me,after instuling the last software update,the programs and games and everything i have download it can't open!

    Have you tried the basics from the manual?
    restart, reset, restore.
    iPod touch User Guide (For iOS 4.3 Software)

  • Hey every one ,i bought a new ipad 2 last month,i am not using it  so much but  sometimes it does respond,hang's up,all games and app come out of there folder . can you plz help me

    hey every one ,i bought a new ipad 2 last month,i am not using it  so much but  sometimes it does respond,hang's up,all games and app come out of there folder . can you plz help me.my email id is [email protected]

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.
    Don't leave your email address on a public forum

  • HT203167 Hi when I try to buy gems in the game a message tell me contact ITunes Store to complete this transition what should I make by steps plz help me !!!

    Hi when I try to buy gems in the game a message tell me contact ITunes Store to complete this transition what should I make by steps plz help me !!!

    Step one:  Do exactly what it told you to do.  Contact itunes support.
    Step two:  Do what itunes support tells you

  • I was going on to a game and my screen turned white and wont turn off Plz help

    My ipod went white and wouldnt turn off.I was playing myhorse then that happer.What happen to my IPod?
    Plz help

    - Try a reset:
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Connect the iPod to your computer and try to restore via iTunes.
    - If screen still white, let the battery fully darain. After charging for an hour try the above again.

  • I have purchsed gem in clash of clan through my credit card but i didnt recieve the gems..it has also reflected in my bank account and my itunes purchase history...how can i get them back??who should i complain to??? plz help....

    i have purchsed gem in clash of clan through my credit card but i didnt recieve the gems..it has also reflected in my bank account and my itunes purchase history...how can i get them back??who should i complain to??? plz help....

    You need to talk to clash of clans first. The game should have a support link.
    If they can't/won't help you then you turn to iTunes support.
    There seem to be a lot of issues with in app purchases in this game because not a day goes by that someone doesn't post a thread asking something similar.

  • Newbie Here..plz help

    Hi Friends, I'm a newbie to Flash Media Server.. i have a
    book titled "Programmin Flash Communication Server"..its kinda
    outdated though.. does nyone know any site thats good for
    newbies?im plannin on makin an two-way audio conferencin site..
    which ll be later embedded into a php file..plz help me out..
    thanx in advance

    10% of total build cost? So if you spend £1000 on a system you should spend £100 on the power supply? I spent just over half of that on my Tagan. I hear what you're saying mind... I good power supply is vital, the amount of people I've seen spending £10 on one just because it's 600W is unbelievable. Not their fault mind, the industry should explain WHY the rails and brand name are more important, they don't though. I wrote into PC Gamer a few months ago asking them to explain this to the greater public, and they gladly obeyed.

  • "Purchase couldn't be completed...unable to connect to iTunes". I've tried ALL suggestions...PLZ help.

    I have iPod Touch 4th Gen. I can purchase game token in 1 game but Not the other!! Get message in other game: "Purchase couldn't be completed...unable to connect to iTunes". I've tried ALL suggestions...PLZ help.

    See:
    Have yo tried when connect to another wifi network?
    Can't connect to the iTunes Store
    For the future, saying " I've tried ALL suggestions" provides with zero information as to what you did try

  • HT5012 Ipad 3 speaker sound in not working.. Headphone is working ..no sound in any application..plz help

    Needs assistance guyz.. I tried so many tricks available in online but nothing works plz help me..

    Well, nobody here reads minds and that means that we don't know what you have already tried. Here is my boilerplate response, and unless you can share more information .......
    1. If you have no sound at all, even in the Music App, try rebooting the iPad.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    2. If you lost sounds for keyboard clicks, games or other apps, email notifications and other notifications, system sounds may have been muted.
    System sounds can be muted and controlled two different ways. The screen lock rotation can be controlled in the same manner as well.
    Settings>General>Use Side Switch to: Mute System sounds. If this option is selected, the switch on the side of the iPad above the volume rocker will mute system sounds.
    If you choose Lock Screen Rotation, then the switch locks the screen. If the screen is locked, you will see a lock icon in the upper right corner next to the battery indicator gauge.
    If you have the side switch set to lock screen rotation then the system sound control is in the control center if you are running iOS 7. Swipe up from the bottom of the screen to get to control center . Tap on the bell icon and system sounds will return.
    If you are running iOS 5 or iOS 6, the system sound control is in the task bar at the bottom. Double tap the home button and swipe all the way to the right in the task bar to get to the speaker icon on the left side. Tap on that and the sounds will return.
    If you have the side switch set to mute system sounds, then the screen lock can be accessed in the same manner as described above.
    This support article from Apple explains how the side switch works.
    http://support.apple.com/kb/HT4085
    3. Try resetting all settings. Settings>General>Reset>Reset all settings. No data will be lost but you will have to enter all of the device settings again.
    4. If you still have no sound, try cleaning the dock connector opening of the iPad with a soft brush and just a little bit of rubbing alcohol.

  • I am unable to view videos in youtube using mozilla plz help

    I am unable to view videos in youtube using mozilla plz help
    duplicate of [/questions/1009851]
    edit: for some reason this user shows as deactivated which I did not do.

    Are you still able to view flash videos and games from other sites?
    If so and are from India then youtube videos among many other sites were blocked. https://support.mozilla.org/en-US/forums/contributors/710463

Maybe you are looking for

  • SOAP:1,007 SRT: Unsupported xstream found: ("HTTP Code 404  : Not Found")

    Dear expert,         When i run sap call .net web service ,it occurs error: SOAP:1,008 SRT: Couldn't create Object: ("ICF Error when creating object for HTTP DESTINATION "tempuri.org": DESTINATION NOT FOUND") Exception of class CX_AI_SYSTEM_FAULT Cou

  • Launch workflow through Custom.pll

    All, We have a requirement to invoke Workflow process for every service request create / update and I am calling the wf like below in custom.pll WHEN-VALIDATE-RECORD XXPPS_CRM_WF_PROCESS.XXPPS_WF_LAUNCH (                                     08291302 

  • Page cannot display error for external user(via aproxy server)

    When i click the self service web application via proxy server. Following error thorugh Error : Cannot Display Page You cannot complete this task because one of the following events caused a loss of page data: Your login session has expired. A system

  • Safari Will NOT Launch- Please help!

    Hi- I have a clean install Leopard (all updates too) on my new Macbook Pro. Just started today: When I click on Safari the dot underneath the Safari on the dock shows and Safari shows at the top (menus), but no window comes up and when I put my mouse

  • MInimum price for a freight cond

    Hi Gurus, Here is teh issue I am facing.  I need to enter minimum price for a pricing condition. Here is the example Per kg rate     From    1 KG  to  25 KG        20 INR per  KG                        From   26 KG to  50 KG        18 INR per KG