Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 50
  1. #16
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    It's not necessary to use a class there. It's just that the code could be improved (a lot), but that comes with practice and time. Don't worry too much about it. You will eventually improve with time. : )
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  2. The Following 2 Users Say Thank You to 'Bruno For This Useful Post:

    Hell_Demon (06-01-2011),Lyoto Machida (06-01-2011)

  3. #17
    VirtualSia's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    200
    Reputation
    -57
    Thanks
    12
    My Mood
    Tired
    Nice going. Again you edited my comment, I'm starting to think you have a sexual relationship to Virtual Void.

  4. #18
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Quote Originally Posted by Brinuz View Post
    It's not necessary to use a class there. It's just that the code could be improved (a lot), but that comes with practice and time. Don't worry too much about it. You will eventually improve with time. : )
    Thanks for some good news XD

  5. #19
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Yes, no need for classes here.

    But CLEARLY, this code could be minimized to probably 300-400 lines of code easily just using for loops.

    But aside from that, good job.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  6. The Following User Says Thank You to VvITylerIvV For This Useful Post:

    Lyoto Machida (06-01-2011)

  7. #20
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Quote Originally Posted by VvITylerIvV View Post
    Yes, no need for classes here.

    But CLEARLY, this code could be minimized to probably 300-400 lines of code easily just using for loops.

    But aside from that, good job.
    I know , but i dont like to use mutch loops, cause it lags..

  8. #21
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by -Away View Post


    I know , but i dont like to use mutch loops, cause it lags..
    Meh, it'd be a LOT neater.

    But, if you really are so against using loops. I've found a few ways to remove many lines of code (at least 50-60) without loops.

    But I'm at school and can't really do much right now. :P

    EDIT:

    Oh, and I also found a way to make the UI a bit more appealing, by adding a few more lines of code. But meh, it's a great program all in all.

    And I just noticed, you use if (Player == 'x' || Player == 'X');

    Why not use the toupper function?

    Player = toupper(Player);

    PLUS! It gave me a GENIUS idea to make an RPG on a console application.
    Last edited by VvITylerIvV; 06-01-2011 at 02:13 PM.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  9. #22
    NoShame's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    In a bed with a girl.
    Posts
    1,715
    Reputation
    -14
    Thanks
    76
    My Mood
    Happy
    lol nice game but its so boring
    ỳô шнат’ŝ чр, §üçжа
    ɳɨʛɢa

    Most Trusted Buyer/Seller on MPGH is nysm1
    Previous names: yoyobasha

  10. #23
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Quote Originally Posted by VvITylerIvV View Post
    Meh, it'd be a LOT neater.

    But, if you really are so against using loops. I've found a few ways to remove many lines of code (at least 50-60) without loops.

    But I'm at school and can't really do much right now. :P

    EDIT:

    Oh, and I also found a way to make the UI a bit more appealing, by adding a few more lines of code. But meh, it's a great program all in all.

    And I just noticed, you use if (Player == 'x' || Player == 'X');

    Why not use the toupper function?

    Player = toupper(Player);

    PLUS! It gave me a GENIUS idea to make an RPG on a console application.
    Well almost the same thing anyway :P
    btw Thanks for the help

  11. The Following User Says Thank You to Lyoto Machida For This Useful Post:

    VvITylerIvV (06-01-2011)

  12. #24
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Nah, thank you for showing me the getasynckeystate is usable in console applications. I never realized that...
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  13. The Following User Says Thank You to VvITylerIvV For This Useful Post:

    Lyoto Machida (06-01-2011)

  14. #25
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    Loops aren't slow.
    Code:
    if (GetAsyncKeyState(VK_SOMETHING) & 0x800)
    Thats the proper way to check for a key press.

  15. #26
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    Quote Originally Posted by Fovea View Post
    Loops aren't slow.
    Code:
    if (GetAsyncKeyState(VK_SOMETHING) & 0x800)
    Thats the proper way to check for a key press.
    for loops are somewhat slow... A LITTLE slower than placing the code there, but makes the code a lot more easy to manage and read.

    (seeing as they have like 2 more checks every time they do the code, it slows it down unnoticeably unless you time them both for about 40 hours or so...)
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

  16. #27
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    Any loop can and will be unrolled by the compiler if deemed necessary.

  17. #28
    Lyoto Machida's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Far away with girls
    Posts
    3,734
    Reputation
    133
    Thanks
    1,621
    My Mood
    Aggressive
    Quote Originally Posted by Fovea View Post
    Loops aren't slow.
    Code:
    if (GetAsyncKeyState(VK_SOMETHING) & 0x800)
    Thats the proper way to check for a key press.
    The other way works too, but why that & 0x800, and difference?

  18. #29
    Fovea's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Posts
    325
    Reputation
    101
    Thanks
    411
    My Mood
    Amused
    Quote Originally Posted by MSDN
    Return Value

    Type: SHORT

    If the function succeeds, the return value specifies whether the key was pressed since the last call to GetAsyncKeyState, and whether the key is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the previous call to GetAsyncKeyState. However, you should not rely on this last behavior; for more information, see the Remarks.
    Quote Originally Posted by MSDN
    Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive multitasking nature of Windows, another application can call GetAsyncKeyState and receive the "recently pressed" bit instead of your application. The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications (which are non-preemptive) and should not be relied upon.
    Woops, its 0x8000 not 0x800. 0x8000 is a bit mask checking if the highest bit in the return value, which is a short, is set.

  19. The Following 2 Users Say Thank You to Fovea For This Useful Post:

    Lyoto Machida (06-02-2011),WildPancake (06-02-2011)

  20. #30
    VvITylerIvV's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    The streets
    Posts
    668
    Reputation
    5
    Thanks
    61
    My Mood
    In Love
    If your using getasynckeystate in more advanced ways, not including 0x8000 will screw up your program due to this new thing called multithreading which wasn't around when getasynckeystate was created.

    So if it has a chance to screw up your program, you SHOULD have enough experience to know how to fix it. Logically.
    Favourite quotes:

    Code:
    I don't need easy, I just need possible. ~ Me 
    
    There are three birds on a fence. Two decide to fly away, how many are left? Three, just because you decide to do something doesn't mean you've done it. ~ Don't know who said this
    
    Do not go where the path may lead, go instead where there is no path and leave a trail. ~ Ralph Waldo Emerson
    Quote Originally Posted by VirtualSia View Post
    You both have a very weird and awkward view on Computer science.
    Computer science is about computing, which is programming.
    Definition of computing: The use or operation of computers.
    Turning on my computer = computing = programming
    LAWLFAIL

Page 2 of 4 FirstFirst 1234 LastLast