Sha256: 810afe95d06f2cf47c37e17b33b103a84ab78c4c10c2404d9adb6405f6a7d062
Contents?: true
Size: 1.1 KB
Versions: 11
Compression:
Stored size: 1.1 KB
Contents
# -*- coding: utf-8 -*- require 'xot/setter' require 'xot/universal_accessor' require 'xot/block_util' require 'reflex/ext' require 'reflex/helper' module Reflex class Shape include Xot::Setter include Hookable include HasFrame include HasTags alias sensor? sensor universal_accessor :name, :selector, :density, :friction, :restitution, :sensor, :category_bits, :collision_mask def initialize(options = nil, &block) super() set options if options Xot::BlockUtil.instance_eval_or_block_call self, &block if block end def on_contact(e) end def on_contact_begin(e) end def on_contact_end(e) end private def on_contact!(*args) call_contact!(*args) owner&.delay {on_contact(*args)}# delay to avoid physics world lock end def on_contact_begin!(*args) call_contact_begin!(*args) owner&.delay {on_contact_begin(*args)} end def on_contact_end!(*args) call_contact_end!(*args) owner&.delay {on_contact_end(*args)} end end# Shape end# Reflex
Version data entries
11 entries across 11 versions & 1 rubygems