Results 1 to 2 of 2
  1. #1
    Kaytes is offline Member
    Join Date
    Apr 2012
    Rep Power

    Default Why. Does. This. Not. Work.

    So, I'm self-teaching myself Java, for about three months now. For this program, I'm using objectdraw for the visual elements. Java and objectdraw are both latest versions. This program is a casting simulator in the style of Magicka, where you can combine elements. What I'm trying to have it do is display the spell type (AoE or bolt) first, and then two possible elements. ie; "A bolt of ice and water" or "An area attack of electricity and arcane power." However, it's displaying as "A bolt of and water.water and". This is because in onMousePress there is a series of ifs for each element. Java seems to be seeing the "second" boolean as true, though I know that it should be false by default, and I haven't declared it as true. This is really kicking my ass. Any help?

    [Java] CastingSys -

    PS: Ignore the element1 and element2 Strings, they are for something later.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    Default Re: Why. Does. This. Not. Work.

    In your code I see things such as:

    Java Code:
    if (second = true); ...
    if (third = false); ...
    Two remarks: the comparison for equality operator is ==, not = and those semi colons don't belong there; they introduce an empty statement.

    kind regards,

    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. applet call dll work in Win2000 but not work in WinXP
    By manhcuongtin4 in forum Java Applets
    Replies: 1
    Last Post: 07-14-2011, 02:45 PM
  2. Getting SWT app to work on a different OS
    By Ravioli in forum SWT / JFace
    Replies: 0
    Last Post: 02-20-2011, 10:35 AM
  3. Cant seem to get this to work
    By nivekeleets in forum Java 2D
    Replies: 4
    Last Post: 11-13-2010, 08:09 PM
  4. Why won't this while loop work?
    By trueblue in forum New To Java
    Replies: 6
    Last Post: 05-23-2009, 09:10 PM
  5. how would i get this to work...?
    By deeadeed in forum New To Java
    Replies: 6
    Last Post: 12-06-2007, 03:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts