#need help for a task

9 messages · Page 1 of 1 (latest)

nova vessel
#

Hi, ill put the instructions in the images, for this one, I need an message to print "out of breath....." if I dash 2 times in a row, except for some reason I cant get it to work, there is an example output. Ill put my code in a file in here.

red flaxBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

nova vessel
#

code is here, this is kind of beginner, so a lot of advanced stuff arent allowed

cyan elbow
#

I would make an variable OUT_OF_BREATH, and when a dash is performed i would set this to true. When another move is performed you would set this to FALSE. Each time before dashing you would check this variable to see if the player is able to dash. Is this the kind of solution you are looking for?

#

It's an simple but effective solution.

#

Ex:

#
// Reset the out of breath status for normal moves. (Workaround for the 1 move cooldown, will still produce the same result)
if (movement_char_input != 'W' && 
             movement_char_input != 'A' && 
             movement_char_input != 'S' && 
             movement_char_input != 'D') {
             
  is_out_of_breath = FALSE;
}

if (is_out_of_breath) {
           printf("insert your text here :D\n");
 } else {
        move(); //Insert your already made movement code in here
                        
        // Set out of breath for next round
        is_out_of_breath = TRUE;
} 

cyan elbow
#

Indentation is so off, don't copy paste this code

cyan elbow
#

@nova vessel Was that the response you were looking for?