shooting

Non-platform specific questions.

shooting

Postby yourownskills » Thu Mar 22, 2012 6:59 pm

I made a bullet actor and made a player actor and put it in the KEYDOWN input... I got it to work but when I hold the button down it streams the bullet..Im using the Create Actor in the Keydown. My skype is

snake85027@yahoo.com
Attachments
setup.jpg
streamingShot.jpg
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby Game A Gogo » Thu Mar 22, 2012 7:01 pm

When creating the keydown event, make sure that Repeat is set to no
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: shooting

Postby yourownskills » Thu Mar 22, 2012 7:18 pm

oooh maaaaaaaaaaan, thanks for that... I could have swore I had that disabled. Thats what happens when you sit at the computer to long.
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby yourownskills » Thu Mar 22, 2012 7:47 pm

Image


So right now I got the jump working and all that....But I cant just keep on going up if I keep in clicking the spacebar so it looks like im flying. How can I prevent that from happening?


yvelocity = -8;


thats my code for KeyDown
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby Hblade » Thu Mar 22, 2012 7:56 pm

http://www.youtube.com/playlist?list=PL1F157AEB67C6265E

You can learn more about collision there :) Advanced Collision even :D

Of course my methods aren't as pro as others but they work :)

Also episode 2 will help you with your jumping bug.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: shooting

Postby yourownskills » Fri Mar 23, 2012 5:25 am

yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby Hblade » Fri Mar 23, 2012 5:32 am

make sure repeat is off, and watch this vid, it shows you how to jump:


http://www.youtube.com/watch?v=XEnNFrMb72o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: shooting

Postby yourownskills » Fri Mar 23, 2012 6:57 pm

So I got everything working...but for some odd reason I cant jump again if Im on this fence collision. Any ideas.
Attachments
cantjump.jpg
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby yourownskills » Fri Mar 23, 2012 8:18 pm

never mind figured it out...had to put a jump scripted in the player for the tree collider.
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby yourownskills » Sat Mar 24, 2012 1:15 am

i cant find something on double jump
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby yourownskills » Sat Mar 24, 2012 5:04 am

I have a question about HP and how to set it up..

I have my 3 different pngs that I want to represent the 3 different stages of being hit.... I dont know what to do next...any advice would be greatful. Im just an artist, not a programmer.
Attachments
healthbar.jpg
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby skydereign » Sat Mar 24, 2012 9:02 am

I assume you mean how to make the hp bar display (opposed to the player having different animations). To do that create a single animation for your hp bar actor. The first frame should represent 0 hp, the next one would be 1, and so on. In your case that means 0 hearts, 1 heart, 2 hearts, and 3 hearts. You also will need to create an hp variable. Set it to 3 when you want to initialize the hp (player's create actor for instance) then each time the player gets hurt reduce it by 1. And for your actual hp display actor, in its create set its animation direction to stopped (so it doesn't cycle through the animation). Lastly to display, you can use this.
Code: Select all
animpos=hp_var;

animpos is the frame that the animation is on. You'll notice if you made the animation correctly, when hp=0 the frame is 0 (with 0 hearts) and so on.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: shooting

Postby yourownskills » Sat Mar 24, 2012 9:18 am

thanks, ive been up forever trying to figure out the best way to animate his attacks....

im no programmer, I just started using this a few days ago. im having problems with seeing the entire attack animation... I select key down and pick my attack animation..when i go to test it..its to fast and doesnt finish because i release the button that im using for the attack... so it may play 2 frames out of five. how can i get it to play the entire attack animation even though i let go of the attack button?
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Re: shooting

Postby skydereign » Sat Mar 24, 2012 9:23 am

Releasing the key doesn't by default change the animation back to the other one. That must be something you added. So, the way you would do it is have the keydown (no repeat) change the animation to your attack animation. Then, on the animation finish event for the attack animation, you'll probably want to reset it back to the player's normal animation, so do so in that event.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: shooting

Postby yourownskills » Sat Mar 24, 2012 10:35 am

im trying to get my character to attack facing right as well as attacking when facing left..and while jumping...
i did ADD EVENTS key Down...change animation


I followed a tutorial on youtube for the bottom code, i dont really understand it. Im a graphics guy. So I tried adding the attack animations differently from what i learned in a different tutorial.

this is in my Player--Draw Actor.....so i can move left and right and jump

char *key=GetKeyState();
int dir=key[KEY_RIGHT]-key[KEY_LEFT];
int j=key[KEY_SPACE];
switch(dir)
{
case 0: //none or both
if(animindex==0)
{
ChangeAnimation("Event Actor", "charStopLeft", NO_CHANGE);
}
else if(animindex==1)
{
ChangeAnimation("Event Actor", "charStopRight", NO_CHANGE);
}


break;

case -1: //Left
Collider. x-=5;
ChangeAnimation("Event Actor", "charLeft", NO_CHANGE);
break;

case 1: //Right
Collider. x+=5;
ChangeAnimation("Event Actor", "charRight", NO_CHANGE);
break;
}

if(Collider.yvelocity<10)
Collider.yvelocity+=.5;

switch(j)
{
case 0:
break;
case 1:
if(!jump)
{
Collider.yvelocity=-10;
jump=1;

}
break;
}
Attachments
norepeat.jpg
norepeat01.jpg
yourownskills
 
Posts: 40
Joined: Thu Mar 22, 2012 5:02 pm
Score: 1 Give a positive score

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest