RICOCHET INFINITY

For all things Ricochet...
It is currently Mon Oct 23, 2017 7:52 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Player Hit Detection
PostPosted: Fri Sep 23, 2016 6:38 pm 
Offline
User avatar

Joined: Sat Dec 29, 2012 10:30 am
Posts: 188
Location: Ricochet Station, Infinity
Evening, all :)
I've been working on making a homage to Alien Sky in Ricochet Infinity. See the post here: viewtopic.php?f=28&t=27783
And, as you know, enemies in space shooters drop a variety of projectiles: bullets, bombs, missiles, lasers, etc.
I know how to make my enemies drop projectiles, but I don't know how to make them cause damage to the player ship.

Here's the scene:
Image
- The factory shutdown bricks drop bombs
- Neither the factory shutdown bricks nor the bombs are real; They're just starfish effects.
- I have placed several position markers on the ship's shield, all named "sensor".
- The ship's HP is displayed above the ship and set at 100
What is planned:
- When a projectile comes into contact with one of the "sensors", 20 HP is lost.

I have read gimanski's hit counter help and tried it out: viewtopic.php?f=28&t=28269
Unfortunately, it hasn't worked very well.
Any help will be much appreciated. :D

_________________
Image


Top
 Profile  
 
 Post subject: Re: Player Hit Detection
PostPosted: Wed Sep 28, 2016 9:32 pm 
Offline
User avatar

Joined: Sat Oct 24, 2009 10:49 pm
Posts: 31
Location: Buenos Aires, Argentina
If you're still interested...
You can use a position marker that holds the hp for the player. You just make a new local variable in this marker and name it 'player_HP' for example.

Then (this is the way I'd do it) have each sensor continually send a message in a small radius that the projectiles would receive. Once a projectile receives the message sent by a sensor, it subtracts 20 from the original marker's player_HP variable (you do this with foreign variables). What I like about this is that you can have custom effects for each projectile once these hit the ship. Don't forget to delete the projectile so it isn't detected more than once! (destroy won't work on markers)

Good luck with your project!

_________________
Other in-game name: Ab Aeterno.


Top
 Profile  
 
 Post subject: Re: Player Hit Detection
PostPosted: Thu Sep 29, 2016 6:13 am 
Offline
User avatar

Joined: Sat Dec 29, 2012 10:30 am
Posts: 188
Location: Ricochet Station, Infinity
Wanderbottom wrote:
If you're still interested...
You can use a position marker that holds the hp for the player. You just make a new local variable in this marker and name it 'player_HP' for example.

Then (this is the way I'd do it) have each sensor continually send a message in a small radius that the projectiles would receive. Once a projectile receives the message sent by a sensor, it subtracts 20 from the original marker's player_HP variable (you do this with foreign variables). What I like about this is that you can have custom effects for each projectile once these hit the ship. Don't forget to delete the projectile so it isn't detected more than once! (destroy won't work on markers)

Good luck with your project!


Don't worry, Wanderbottom. I'm still interested in the game.
It's just that replies sometimes take a long time now that things have dried up a bit.

So, if we're talking about this in simple terms, I would make them send a message to my HP marker if a bomb comes within a certain radius.
I plan to make the radius the same as that of the sensor marker.
It will then send a message to the HP marker to set a foreign variable, that is the HP-20.
The bombs will create an explosion marker with sound and delete themselves.

Anyways, I will give that a try, and let you know how I got on.
Thanks for the tips, Wanderbottom, and good luck to you too!

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group