Added custom player model example
This commit is contained in:
parent
622c9b79b1
commit
1db8dcc1d9
Binary file not shown.
|
@ -0,0 +1,22 @@
|
|||
-- name: Custom Koopa Player Model
|
||||
-- description: Press DPAD+DOWN to become a Koopa!\n(by Super Keeberghrh)
|
||||
|
||||
E_MODEL_KOOPA_PLAYER = smlua_model_util_get_id("koopa_player_geo")
|
||||
|
||||
function mario_update_local(m)
|
||||
if (m.controller.buttonPressed & D_JPAD) ~= 0 then
|
||||
gPlayerSyncTable[0].modelId = E_MODEL_KOOPA_PLAYER
|
||||
end
|
||||
end
|
||||
|
||||
function mario_update(m)
|
||||
if m.playerIndex == 0 then
|
||||
mario_update_local(m)
|
||||
end
|
||||
|
||||
if gPlayerSyncTable[m.playerIndex].modelId ~= nil then
|
||||
obj_set_model_extended(m.marioObj, gPlayerSyncTable[m.playerIndex].modelId)
|
||||
end
|
||||
end
|
||||
|
||||
hook_event(HOOK_MARIO_UPDATE, mario_update)
|
|
@ -55,3 +55,4 @@ All of this is a holdover from when there were only two players. It was a reason
|
|||
- [Add to Goomba Behavior](examples/behavior-add-to-goomba.lua)
|
||||
- [Behavior with Surface Collisions](examples/behavior-surface-collisions.lua)
|
||||
- [Custom Box Model](examples/custom-box-model)
|
||||
- [Custom Player Model](examples/koopa-player-model)
|
||||
|
|
Loading…
Reference in New Issue