Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/27/26 13:15
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (TipmyPip, alx, Martin_HH, 1 invisible), 5,110 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Random Animation #129588
05/12/07 23:22
05/12/07 23:22
Joined: Jul 2006
Posts: 28
B
burning_devil Offline OP
Newbie
burning_devil  Offline OP
Newbie
B

Joined: Jul 2006
Posts: 28
Hi, I am making a fighting game, and for some reason I can get everything correct besides basic AI like random attacks. I have a character that has 4 different animation attacks(punch,kick,high punch,and low kick)Can anyone please help me understand how to use random attacks like kick or punch in a random event.

Re: Random Animation [Re: burning_devil] #129589
05/12/07 23:26
05/12/07 23:26
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
Use random

define attack_punch,0;
define attack_kick,1;
define attack_highpunch,2;
define attack_lowkick,3;

var ran = int(random(4));

if(ran == attack_punch) {punch();}
if(ran == attack_kick) {kick();}
if(ran == attack_highpunch) {highpunch();}
if(ran == attack_lowkick) {lowkick();}


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1