test_buggy.rb

Path: examples/test_buggy.rb  (CVS)
Last Update: Wed Jul 27 22:48:36 EDT 2005

test_buggy.rb - A (sort of) port of the test_buggy.cpp test in the ODE distribution

$Id: test_buggy.rb 96 2005-07-28 02:48:31Z ged $ Time-stamp: <04-Feb-2003 15:21:35 deveiant>

Authors:

  # Michael Granger <ged@FaerieMUD.org>

Copyright © 2002, 2003 The FaerieMUD Consortium.

This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit creativecommons.org/licenses/by/1.0 or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Required files

ncurses   ../utils   ode  

Methods

Included Modules

UtilityFunctions ODE Example

Constants

CATEGORY_MOVING = (1 << 0)   Define some categories for culling collisions
CATEGORY_STATIONARY = (1 << 1)

Public Instance methods

[Source]

# File examples/test_buggy.rb, line 300
    def hidePauseWindow 
        $pauseWindow.wborder( 32,32,32,32, 32,32,32,32 )
        $pauseWindow.clear
        $pauseWindow.refresh
        $pauseWindow.delwin
    end

[Source]

# File examples/test_buggy.rb, line 279
    def printCenter( row, msg, window=Ncurses.stdscr )
        cols = []; lines = []
        window.getmaxyx( lines, cols )
        col = (cols[0] - msg.length) / 2
        row = lines[0] if row > lines[0]
        window.mvprintw( row, col, msg )
    end

[Source]

# File examples/test_buggy.rb, line 287
    def showPauseWindow 
        msg = "* PAUSED *"
        starty = (Ncurses.LINES - 3) / 2
        startx = (Ncurses.COLS - msg.length - 4) / 2
        
        $pauseWindow = Ncurses.newwin( 3, msg.length + 4, starty, startx )
        $pauseWindow.attr_set( Ncurses::A_STANDOUT, Ncurses.COLOR_PAIR(3), nil )
        $pauseWindow.box( 0, 0 )
        $pauseWindow.mvwprintw( 1, 2, msg )

        $pauseWindow.refresh
    end

[Validate]