want help in making hp bar and collision

Ask questions and request art/music.

want help in making hp bar and collision

Postby aamod » Sat Oct 19, 2013 9:17 am

I am making a game in which i want

health bar for player but when different projectile had fire health should decrease eg:stone is thrown it should decrease to 1,gun is fire decrease 5

i had created a crate(object) which is moving with player i want it must not move.

as my game start the mouse arrow should be change

thanks
aamod
 
Posts: 5
Joined: Tue Oct 08, 2013 3:28 pm
Score: 0 Give a positive score

Re: want help in making hp bar and collision

Postby barney12345 » Sun Oct 20, 2013 12:20 am

For ur first part, go to
viewtopic.php?f=27&t=7744
and for ur second part, can u explain any better. I think u mean how to stop it moving on collision. If that's the case:
click on main guy, click on events, collision, any side of crate, physical response, there should now be 4 1's going down the new screen, change the 3rd into a 0.
And for the final part, I have no idea what ur trying to say sorry.
Hope that's what u wanted
Darth Vader called... he wants his cookies back
User avatar
barney12345
 
Posts: 122
Joined: Wed Nov 07, 2012 6:52 am
Location: A land down under
Score: 4 Give a positive score

Re: want help in making hp bar and collision

Postby aamod » Sun Oct 20, 2013 1:44 pm

i was just taking about changing the cursor.
aamod
 
Posts: 5
Joined: Tue Oct 08, 2013 3:28 pm
Score: 0 Give a positive score

Re: want help in making hp bar and collision

Postby barney12345 » Sun Oct 20, 2013 8:08 pm

unless u make an actor which follows the mouse, you cant sorry
Darth Vader called... he wants his cookies back
User avatar
barney12345
 
Posts: 122
Joined: Wed Nov 07, 2012 6:52 am
Location: A land down under
Score: 4 Give a positive score

Re: want help in making hp bar and collision

Postby DarkParadox » Sat Oct 26, 2013 2:44 am

Actually, you can!
There's a special function we can use in the script editor called ChangeCursor.
You need to have an image for it, of course.

To get it set up you have to do something like in this demo:
MouseDemo.zip
(104.69 KiB) Downloaded 207 times


What's going on here is:
I added a canvas actor (A region would work as well, and you should probably use a region instead).
Make sure to set the z-depth of this actor as high as possible, and parent it to the view.
Then, on the canvas actor, I created an event for Mouse Enter which has a script for script editor reading:
Code: Select all
ChangeCursor("Event Actor", "data/cursor.gif", 1, 1, 0, 0);

Look for the command in the variables/functions menu
cursor.gif being the image I use in the data folder of the game.

I also went in and created two Create Actor events that do Event Disable for Mouse Down or Mouse Up events.
This is important! If you don't do this, nothing will respond to clicks from your mouse.

When creating the cursor image, GameEditor will take the top left pixel of the image and use it as the transperant colour, so I making the background of the cursor image pink, moving the cursor down one row so that the top left pixel is the pink colour, and then using it. Also make sure to set the hotspot to "1" to account for the fact that you moved the cursor down on the image. Your result should be something like this:
10-25-2013 10-40-49 PM.png
10-25-2013 10-40-49 PM.png (556 Bytes) Viewed 4137 times
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: want help in making hp bar and collision

Postby aamod » Thu Oct 31, 2013 4:26 am

Again of that collision with crate

i do main actor=>collision=>crate,any side,yes(repeat)=>4 1(for mass);1 0(for final velocity)

But still the crate is moving.(The crate is small in size of character)
aamod
 
Posts: 5
Joined: Tue Oct 08, 2013 3:28 pm
Score: 0 Give a positive score


Return to Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron