ObstacleWatcher.emam 453 Bytes
Newer Older
Jean-Marc Ronck's avatar
Jean-Marc Ronck committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package de.rwth.supermario.haller.environment;


component ObstacleWatcher {
    ports
    
        in Z ObstacleDistX,
        in Z ObstacleDistY,
        
        out Z inJumpRange;

    implementation Math {
        //Empirical distance values
        Z jumpRangeX = 96;
        
        if((abs(ObstacleDistX) < jumpRangeX) && (ObstacleDistX != -1))
            inJumpRange = 1;
        else
            inJumpRange = 0;
        end
        
    }
}