Talk:How do I implement new keys for the player with hero jumps as an example?

From OHRRPGCE-Wiki

Jump to: navigation, search

Mike C. I'd like to point out a few things:

  • Those are rather odd "example" IDs. I'd have picked something like, say, 1 and 2.
  • Perhaps you should ask someone else to proofread your questions before you go ahead and add an answer for them.
  • Your code is inefficient, and while it's not, technically, wrong, it's convoluted. Are you familiar with how a while command is supposed to be used?

Wrong:

foo:=true
while(foo) do, begin
 foo:=false
 #these commands will only be run once
 wait(1) #????
end

Right:

foo:=true
while(foo) do, begin
 if(some flag is set) then (foo:=false)
 #these commands will be run until some flag is set.
 wait(1) #NOW we can worry about not locking up the engine
end

The first example (Wrong) would be better written like this:

#these commands will only be run once
Personal tools