Skip to content

Suggestion/Contribution for a more dynamic fire. #15

@lexaterra

Description

@lexaterra

I added 3 variables:

int shuffle=0;
int bounce=0;
int randheight=0;

loop:
while (sig_caught == 0 && (c = getch()) != 'q') {
// the following is the code I came up with
shuffle++;
if (shuffle == 10)
{
bounce++;
shuffle=0;
}
maxtemp = bounce;
if (bounce > (12 + randheight))
{
randheight=rand() % 2;
bounce = 12 - randheight;
}
// end of my code

    if(c == KEY_UP || c == 'k') maxtemp++;
    if((c == KEY_DOWN || c == 'j') && maxtemp > 1) maxtemp--;

Let me know what you think?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions