Results 1 to 10 of 15

Thread: Glitch on my game

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Thanks Silver and everyone for your time! luckily i fixed all the bugs by myself .
    I have a question about programming in general:
    So i have this readln(key) .
    and it := 'F' for example.
    and if i say
    if (key = 'F') and (variable > 0) then begin
    -syntax-
    end;
    it wont work like this... it will just jump to the other task even if i tell it
    else if (variable > 0) then begin
    writeln('You don have the enough variable');
    how is this a fix?
    If you don't understand me ill just post the code and you guys will see about what im talking ;\
    Last edited by smexhy; 08-04-2012 at 09:34 AM.

  2. #2
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2
    Hi smexhy,

    My first question... are you sure Key is equal to 'F'? (i.e. upper case F). Unless you've got caps lock on or are holding down the shift, key will be equal to 'f' (i.e. lower case F) when you press the F key.

    I'm not sure there is anything else wrong with your code, but without the full context it's a bit difficult to tell.


    Hope this helps
    :: AthenaOfDelphi :: My Blog :: My Software ::

Bookmarks

Posting Permissions

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