Skip to content

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