| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: Aug 2004
Beiträge: 27
| kurze schnelle Frage: x || (x && x)
Ich frage in einem Spiel Ereignisse ab, die nur selten vorkommen, aber eben passieren. Da ich keine Lust hab, zu testen bis das mal eintritt, hier meine Frage: Darf ich sowas? Code: while (tempactiontile == "L" || (action_startpositiony == 0 && action_startpositionx == 0)) {
action_startpositiony = (random(grid.length));
action_startpositionx = (random(grid[1].length));
tempactiontile = tilelist[grid[action_startpositiony][action_startpositionx]-gridsubtractor];
} also das AND in Klammern nach dem OR. weiß das jemand? thanx |
| | |
| | #2 (permalink) |
| Neuer User Registriert seit: Aug 2004
Beiträge: 27
|
hier der Code dazu: while (tempactiontile == "L" || (action_startpositiony == 0 && action_startpositionx == 0)) { action_startpositiony = (random(grid.length)); action_startpositionx = (random(grid[1].length)); tempactiontile = tilelist[grid[action_startpositiony][action_startpositionx]-gridsubtractor]; } |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |