Multi hit

Talk about making games.

Multi hit

Postby Behdadsoft » Tue Oct 22, 2013 7:31 pm

Hi.

I want make a game like street of rage but before every thing I Need know how work multi hit ? mean hit Punches and kicks together.

Thanks
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Multi hit

Postby knucklecrunchgames » Wed Oct 23, 2013 10:16 pm

lol I'm making a game like this too, good luck.
User avatar
knucklecrunchgames
 
Posts: 1071
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Multi hit

Postby Behdadsoft » Thu Oct 24, 2013 1:47 pm

lol I'm making a game like this too, good luck.


ok. I have question : how can use one key for several animation? mean if I press SPACE Key the first time run animation1, and if press SPACE Key Secondly run animation2 and so on.

Thanks
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Multi hit

Postby Wertyboy » Thu Oct 24, 2013 3:30 pm

Behdadsoft wrote:
lol I'm making a game like this too, good luck.


ok. I have question : how can use one key for several animation? mean if I press SPACE Key the first time run animation1, and if press SPACE Key Secondly run animation2 and so on.

Thanks

Haven't try this before, But Variables and Timer should work ;)
User avatar
Wertyboy
 
Posts: 543
Joined: Tue Jun 15, 2010 12:38 pm
Location: HCM City, Vietnam
Score: 44 Give a positive score

Re: Multi hit

Postby Soullem » Sat Oct 26, 2013 12:53 am

What I would do is to create a variable called hitStage or whatever you would want. I would increase this by 1 everytime you hit the attack button (space). Then I would create a switch statement that plays the attack animation depending on the value of hitStage. Then you could write a code that if you do not press attack after a while it resets hitStage to 0, making you start back on the first part of your attack combo. Thats what i'd do. If you need more hinters on the coding just ask!
Current Project:
The Project That needs to be Done -- Pokemon http://game-editor.com/forum/viewtopic.php?f=4&t=12591

Temporarily Abandoned:
Souls of Gustara -- Awesome upgrade blimp game 42%ish
Eggventures of Eggman -- Adventure Game 20%ish
User avatar
Soullem
 
Posts: 105
Joined: Thu Aug 02, 2012 3:12 pm
Score: 5 Give a positive score

Re: Multi hit

Postby Behdadsoft » Sat Nov 16, 2013 8:44 pm

thanks Soullem :)
+1

but I have a Problem:

I wrote this code for change animation when my player each press a key.

Player(Axel) => Key Down => a => Script Editor
Code: Select all
hit++;
switch (hit)
{
    case 0:
    ChangeAnimation("Axel", "Axel Right-LeftPunch", FORWARD);
    break;
 
    case 1:
    ChangeAnimation("Axel", "Axel Right-LeftPunch", FORWARD);
    break;
 
    case 2:
    ChangeAnimation("Axel", "Axel Right-RightPunch", FORWARD);
    break;
 
    case 3:
    ChangeAnimation("Axel", "Axel Right- Kick", FORWARD);
    break;
}


But I don't know how can reset hit with timer when player don't press any key?
There is no possible way, if we found will make a way.

http://behdadsoft.com/
*******************************************************************
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0
User avatar
Behdadsoft
 
Posts: 207
Joined: Wed Dec 16, 2009 9:19 pm
Score: 2 Give a positive score

Re: Multi hit

Postby bat78 » Tue Nov 19, 2013 11:44 pm

Global Code:
Code: Select all
short int checksum;


Key Down even of your actor (Repeat Disable):
Code: Select all
checksum += 1;
if (checksum >= 3) checksum = 1;
if (checksum == 1) x += 5;
if (checksum == 2) x -= 5;


Of course, you can change x += 5 and x -=5 with anything you wish. Like changing animation or so.
Thats how you can use one single button, used for a several functions. Well at least thats how i would do.
_______________________________________________________________________________________________

If you want to use simple timer, made with code you can use that down. It works only if you don't change the
game's default FPS rate. By default its 30. That fps determine the speed of transmitting frames of an movement.
Global Code:
Code: Select all
void after(const int seconds)
{
    int ms; ms++;
    if (ms / 25 == seconds) hit = 0; //Or what happens when the time is up
}


Any Actor -> Draw Actor:
Code: Select all
after(10); //10 stands for the seconds you wish

_______________________________________________________________________________________________

Street of rage is a good game of SEGA. You can also use dual key hit:
Axel -> Key Down -> qe (all keys are pressed)
Code: Select all
//code


You can also do the same for combos:
Axel -> Key Dow -> qwe (all keys are pressed in order)
Code: Select all
//code
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest