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/05/27 18:52 (8 years ago)] – external edit 127.0.0.1 | en:tutorials:spawners:electrical_sparks [2025/09/30 17:26 (7 weeks ago)] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 75: | Line 75: | ||
| <WRAP center round box 60%> | <WRAP center round box 60%> | ||
| - | {{ :en:tutorials: | + | {{ tutorials: |
| </ | </ | ||
| Line 92: | 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 mousePosition | + | |
| - | orxVECTOR sparksPosition = { 0,0,0 }; | + | orxVECTOR mousePosition; |
| - | orxMouse_GetPosition(& | + | |
| - | + | | |
| - | orxOBJECT *sparks = orxObject_CreateFromConfig(" | + | |
| - | orxObject_GetPosition(sparks, | + | orxOBJECT *sparks = orxObject_CreateFromConfig(" |
| + | if (sparks) | ||
| + | { | ||
| + | orxVECTOR sparksPosition; | ||
| + | | ||
| + | |||
| + | sparksPosition.fX = mousePosition.fX; | ||
| + | sparksPosition.fY = mousePosition.fY; | ||
| + | |||
| + | orxObject_SetPosition(sparks, | ||
| + | } | ||
| + | } | ||
| - | sparksPosition.fX = mousePosition.fX; | ||
| - | sparksPosition.fY = mousePosition.fY; | ||
| - | |||
| - | orxObject_SetPosition(sparks, | ||
| - | } | ||
| - | |||
| return orxSTATUS_SUCCESS; | return orxSTATUS_SUCCESS; | ||
| } | } | ||
| Line 116: | Line 121: | ||
| <code ini> | <code ini> | ||
| - | [KeysForInput] | + | [Input] |
| KEY_ESCAPE | KEY_ESCAPE | ||
| MOUSE_LEFT | MOUSE_LEFT | ||