skip to content
Orx Learning
User Tools
Admin
Log In
Site Tools
Search
Tools
Show page
Old revisions
Export to PDF
Backlinks
Recent Changes
Media Manager
Sitemap
Log In
>
Recent Changes
Media Manager
Sitemap
Trace:
Welcome
Beginner's Guide
Config
Examples
Tutorials
en:examples:orx_scroll:collisions_with_scrollobjects
====== Collisions with ScrollObjects ====== Collisions can be tested in ScrollObjects using the ''OnCollide'' function. The incoming ''_poCollider'' is the ScrollObject that is colliding with ''this'' ScrollObject. Also, the individual parts of both ScrollObjects that are colliding are available in the function. <code c> void Enemy::OnCollide(ScrollObject *_poCollider, orxBODY_PART *_pstPart, orxBODY_PART *_pstColliderPart, const orxVECTOR &_rvPosition, const orxVECTOR &_rvNormal) { if (_poCollider == orxNULL) { return orxTRUE; } const orxSTRING colliderName = _poCollider->GetName(); if (orxString_SearchString(colliderName, "Ship") != orxNULL) { const orxSTRING shipPartName = orxBody_GetPartName(_pstColliderPart); const orxSTRING enemyPartName = orxBody_GetPartName(_pstPart); } } } </code>
en/examples/orx_scroll/collisions_with_scrollobjects.txt
ยท Last modified: 2025/09/30 17:26 (9 months ago) by
127.0.0.1
Page Tools
Show page
Old revisions
Backlinks
Export to PDF
Rename Page
Back to top