Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,227 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: elevator probelm [Re: GaniX] #411586
11/17/12 19:46
11/17/12 19:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You can define skills if it makes it easier to read/ code for you, example:

#define target_z skill2
...
if(my.z < my.target_z) move up;


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: elevator probelm [Re: GaniX] #414403
01/01/13 16:41
01/01/13 16:41
Joined: Jan 2013
Posts: 23
France
M
Mo222 Offline
Newbie
Mo222  Offline
Newbie
M

Joined: Jan 2013
Posts: 23
France
Hello GaniX,

I would advise you to train your skills ...:)

Beyond the joke, skills are very useful if you are willing to place several similar entities in the same level at the same time.

Like superku said , skills are not very difficult to use , once you understand what they are.

In fact, skills are like variables , but they are personal variables of the entity .
Each entity contains similar skills, but the value of the skills may be different.

For example you define a skill for health points of enemies.
So each enemy has health points, but their health points can be different : enemy1 has 100 health points ,enemy2 has 50 healthpoints, enemy3 has 85 health points, etc...

you define skills very simply by writing something like :
Code:
define _health, skill15;



Then if the player hits any enemy , it says "remove enemy health" , with something like :

Code:
if(you == player)//the player has hit the enemy
{
my._health -= 20; //remove 20 hp from enemy's health

}



and since you defined _health as skill15, you can write the same this way :

Code:
if(you == player)//the player has hit the enemy
{
 
 my.skill15-=20;//remove 20 hp from enemy's health
}



however i recommend you to keep using words like _health and not skill15 , because you will be able to understand your code better.

Skills are useful to manage personal variables of numerous entities .

Unlike variables that let you manage global datas that work for every entity if they use them.




Page 2 of 2 1 2

Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | 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