Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] money: Drop money on player death #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

[WIP] money: Drop money on player death #42

wants to merge 1 commit into from

Conversation

dracc
Copy link
Owner

@dracc dracc commented Feb 11, 2019

Give each player $500 on spawn.
Create a pickup on death containing player.Cash * 0.8.
Should be tested before merge.

Closes #33

function onPlayerHealthChange( player, lastHP, newHP ) {
if ( newHP < 0.1 && alive[player.ID]) {
alive[player.ID] = false;
local pickup = CreatePickup( 337, player.World, player.Cash * 0.8, player.Position, 255, true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original game drops a lot of pickups around dead people.

I'd like to mimic this behaviour, with a lot of cash icons around the player (10 or something).

}

function onPlayerHealthChange( player, lastHP, newHP ) {
if ( newHP < 0.1 && alive[player.ID]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use an epsilon, which is smaller 1e-6 or something. Maybe squirrel has an epsilon defined as part of the language?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants