Changeset 448:044b53eb22df for nagslang


Ignore:
Timestamp:
Sep 7, 2013, 1:04:39 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

DEBUG: Command line starting area and point

Location:
nagslang
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • nagslang/constants.py

    r444 r448  
    88    sound=True,
    99    music=True,
     10    # Debug starting position:
     11    area=None,
     12    point=None,
    1013)
    1114
  • nagslang/engine.py

    r437 r448  
    55
    66from nagslang import constants
     7from nagslang.options import options
    78from nagslang.screens.area import AreaScreen
    89from nagslang.events import ScreenChange
     
    2627
    2728        self._world.load()
    28         self.change_screen(starting_area)
     29        if options.point:
     30            x, y = options.point.split(',')
     31            point = (int(x), int(y))
     32            self._world.protagonist.set_position(point)
     33        if options.area:
     34            self.change_screen(options.area)
     35        else:
     36            self.change_screen(starting_area)
    2937        # Dummy resize event, to force us to realise our real size
    3038        # http://stackoverflow.com/q/16442573/8629
  • nagslang/options.py

    r337 r448  
    3737        parser.add_option('--area', help='Initial area')
    3838
     39    if options.debug:
     40        parser.add_option('--point', help='Initial position x,y')
     41
    3942    opts, _ = parser.parse_args(args)
    4043
Note: See TracChangeset for help on using the changeset viewer.