| HeatMan (65) | |||
:P Well: 1) How I can make a better structure? 2) Why the projectile_existence's value is not changed? Thank you! | |||
|
|
|||
| guestgulkan (2915) | |
my compiler runtime checker - informs me that Line 47: else if(r == py && c == px) is a problem because variablepy and px are still uninitialised (when the program reaches that point). So we can start by curing that problem. That for loop starting on Line 28 - sure looks weird - but i suppose the consecutive if/else clauses make it a single statement loop. | |
|
Last edited on
|
|
| HeatMan (65) | |||
|
Okay, I did fixed that py & px problem. Thanks! And now, just to not flood the forum with many messages...
Why the goblin jumps several points (or simply disappear)? He should move just one point each time... | |||
|
|
|||
| guestgulkan (2915) | |
| I just realised, this is the same basic code as the thread about Setting the TextColor. I take it you've decided to give up on using a multi-colour display? | |
|
|
|
| guestgulkan (2915) | |||
|
Here is a Work In Progress, with color added (and some minor mods) with comments. TODO: 1. Stop characters being able to move outside game grid 2. Possible timer - To allow automatic movement of the missile (is that what it is?) and the goblin.
| |||
|
|
|||
| HeatMan (65) | |||
Why this does not block the movement?
| |||
|
|
|||
| firedraco (5494) | |
| Well you will need either a default case that takes you back to the beginning, or a condition on the while loop, since if the user doesn't input anything, the case is basically skipped. Also...why do you have x += 0, y += 0, etc...those do nothing... | |
|
|
|
| HeatMan (65) | |
|
They where made just becuase that... to do nothing... I through in this way the smiley wouldn't move... W00T!!! Did solved this! And was pretty simple... Just a empty else and deleting the two parenthesis, the ! mark, and invertin the signals (> would be <, etc). :DD | |
|
Last edited on
|
|
| firedraco (5494) | |||
There is no reason to do that, it's basically wasting code...it's like doing stuff like this:
They all have no meaning and are basically a waste...without them, the code will do the exact same thing. | |||
|
|
|||
| HeatMan (65) | |
|
Read my edit... Now I did see something strange: The first hit, with the arrow (yep, is a arrow, not a missile), the goblin dosen't suffer nothing, and the secondtie he does gain 40 health... Then the third shot he dies... Why that happens?? | |
|
Last edited on
|
|