Page 2 of 2

Re: Game for arcade cabinet

PostPosted: Thu Mar 20, 2014 12:04 pm
by NightOfHorror
Awesome.

Re: Game for arcade cabinet

PostPosted: Thu Mar 20, 2014 3:49 pm
by retroarcade
Thanks.


Talking about Windows, I've tried to use 7 instead of XP and it works very fine.

Re: Game for arcade cabinet

PostPosted: Thu Mar 20, 2014 8:50 pm
by bat78
Lovely ^^

Re: Game for arcade cabinet

PostPosted: Sun Mar 23, 2014 5:12 pm
by retroarcade
Hi everybody.

Here is my new daily issue. Hope someone can help or point me to a specific thread.

My hero sprite must shoot an enemy.
When the enemy receives the bullet,
A) I want it to be substitute with a transition animation (with all events suspended)
B) and, after some time,
C) it must disappear.

I' ve tried "change animation" and "destroy actor" in the same scripting but the enemy only disappears.
Maybe I should use timer (and even tried) but couldn't use it properly.

Thanks guys!

Re: Game for arcade cabinet

PostPosted: Sun Mar 23, 2014 6:26 pm
by CrackedP0t
Putting ChangeAnimation and DestroyActor in the same script will execute both of them in the exact same frame, so you won't be able to see the animation before it gets destroyed. (If you didn't know, every script you run will run in a single frame; a little different from other tools.)
So, in order to have the animation play, then destroy the actor, here's what I would do:
When the event occurs that you want to trigger the sequence, change the animation to the dying one.
The, add an Animation Finish event with the dying one as the animation, and destroy the actor in it.
To disable the events, use the EventDisable function in the first event and then enable the Animation Finish event and any others you need.
Here's the code that would be used:
In the event when the actor needs to die:
Code: Select all
EventDisable("Event Actor", EVENTALL);
EventEnable("Event Actor", EVENTANIMATIONFINISH);
ChangeAnimation("Event Actor", "dying", FORWARD);

Then, in the Animation Finish event (with "dying" or whatever it is as the animation):
Code: Select all
DestroyActor("Event Actor");


If you have any questions, please ask them!

Re: Game for arcade cabinet

PostPosted: Sun Mar 23, 2014 7:20 pm
by retroarcade
That's the solution! It works perfectly.

Bravo!

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 8:24 am
by retroarcade
Hi guys.

Could please someone solve this puzzle?

I would like the player to hit the spacebar and get one credit and, when he wants to start playing, he should hit return (in this case, he loses one credit and begins to play).

So for +1 credit
key down / spacebar / script editor / credits.textNumber=credits.textNumber+1;

and it works fine: the number of credits increases by one.

Then the player starts a game and loses a credit:

key down / return / script editor / credits.textNumber=credits.textNumber-1;

and surprise the number of credits decreases by 2 ( the player has 3 credits, he hits return and in fact loses two credits).

:?: Strange, isn't it?

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 8:47 am
by MrJolteon
First, declare a variable called "credit".
Then, on key down -> space, put
Code: Select all
credit++;

key down -> return:
Code: Select all
if(credit>=1)
{
    credit-1;
    //start the game
}
//this next part can be skipped if you don't want to run any code if the player does not have enough credits
else if(credit==0)
{
    //the code you want to execute if the player does not have enough credits
}

draw actor:
Code: Select all
credits.textNumber=credit;

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 9:39 am
by lcl
Yeah, MrJolteon has the correct answer, you shouldn't use textNumber as an actual variable in a game, because it acts funny, as you noticed. textNumber is only usable for showing things on the screen.

Anyway, Jolt, your code has one error. Instead of
Code: Select all
credit - 1;

It should be
Code: Select all
credit -= 1;

Which is the same as writing credit = credit - 1;

:)

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 12:02 pm
by retroarcade
Thanks guys.

I've tried and got the same issue (decrease by two).

But can't test anymore (I'm working...).

I'll see tonight.

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 4:31 pm
by bat78
MrJolteon wrote:First, declare a variable called "credit".
Then, on key down -> space, put
Code: Select all
credit++;

key down -> return:
Code: Select all
if(credit>=1)
{
    credit-1;
    //start the game
}
//this next part can be skipped if you don't want to run any code if the player does not have enough credits
else if(credit==0)
{
    //the code you want to execute if the player does not have enough credits
}

draw actor:
Code: Select all
credits.textNumber=credit;

______________________________________________________________________________________________________________
I suggest using shorter code:

First, declare a variable called "credit".
Then, on key down -> (repeat dissabled) space, put
Code: Select all
credit++;

key down -> (repeat dissabled) return:
Code: Select all
if(credit>=1)
{
    credit--;
    //start the game
}
//this next part can be skipped if you don't want to run any code if the player does not have enough credits
else
{
    //the code you want to execute if the player does not have enough credits
}

draw actor:
Code: Select all
credits.textNumber=credit;

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 6:43 pm
by retroarcade
Thanks everybody.

+ 1 for your help!

:D it is so good when all works fine!

Re: Game for arcade cabinet

PostPosted: Tue Apr 01, 2014 11:46 pm
by bat78
Please tell us if you can't figure out something, we'll be glad to help asap. =)

Re: Game for arcade cabinet

PostPosted: Wed Apr 02, 2014 12:20 pm
by retroarcade
Well I followed your methods and it is working fine.

Now I can focus on some funny graphics for the game.

Re: Game for arcade cabinet

PostPosted: Sat May 31, 2014 2:27 am
by Zivouhr
Great looking Arcade Cabinet. I can imagine that took some time to build. Sad to see a lot of the Arcades have disappeared since home consoles and PC graphics have advanced past the arcades. Back in the old days, arcades were the place to go for the latest graphics, but these days, it's right at home; which is a good thing, but it would be nice to have both too. 8)
The Controller cake looks good too. :mrgreen: