This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:tutorials:spawners:electrical_sparks [2018/02/14 04:46 (8 years ago)] – ↷ Page moved from tutorials:spawners:electrical_sparks to en:tutorials:spawners:electrical_sparks iarwain | en:tutorials:spawners:electrical_sparks [2025/09/30 17:26 (7 weeks ago)] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 69: | Line 69: | ||
| See the comments in the config above to see what part each FX plays on the particles. | See the comments in the config above to see what part each FX plays on the particles. | ||
| + | |||
| + | ===== A spark graphic ===== | ||
| + | |||
| + | Any small object will do, even a dot. But you can try this little object if you wish: | ||
| + | |||
| + | <WRAP center round box 60%> | ||
| + | {{ tutorials: | ||
| + | </ | ||
| + | |||
| ===== Setting up Input ===== | ===== Setting up Input ===== | ||
| Line 83: | Line 92: | ||
| <code c> | <code c> | ||
| - | orxSTATUS orxFASTCALL InputEventHandler(const orxEVENT *_pstEvent) | + | orxSTATUS orxFASTCALL InputEventHandler(const orxEVENT *_pstEvent) |
| - | + | { | |
| - | if(orxInput_IsActive(" | + | if(orxInput_HasBeenActivated(" |
| - | orxVECTOR | + | { |
| - | orxVECTOR | + | orxVECTOR mousePosition; |
| + | |||
| + | orxMouse_GetPosition(&mousePosition); | ||
| + | orxRender_GetWorldPosition(&mousePosition, | ||
| + | |||
| + | orxOBJECT *sparks = orxObject_CreateFromConfig("Sparks"); | ||
| + | if (sparks) | ||
| + | | ||
| + | orxVECTOR | ||
| + | orxObject_GetPosition(sparks, & | ||
| + | |||
| + | | ||
| + | sparksPosition.fY = mousePosition.fY; | ||
| - | orxMouse_GetPosition(& | + | orxObject_SetPosition(sparks, & |
| - | + | } | |
| - | orxOBJECT *sparks = orxObject_CreateFromConfig(" | + | } |
| - | orxObject_GetPosition(sparks, & | + | |
| - | sparksPosition.fX = mousePosition.fX; | ||
| - | sparksPosition.fY = mousePosition.fY; | ||
| - | |||
| - | orxObject_SetPosition(sparks, | ||
| - | } | ||
| - | |||
| return orxSTATUS_SUCCESS; | return orxSTATUS_SUCCESS; | ||
| } | } | ||
| Line 107: | Line 121: | ||
| <code ini> | <code ini> | ||
| - | [KeysForInput] | + | [Input] |
| KEY_ESCAPE | KEY_ESCAPE | ||
| MOUSE_LEFT | MOUSE_LEFT | ||