point system + game script help
7 posts • Page 1 of 1
point system + game script help
so I have a few scripting questions...
number 1 : how do you make a points work. example : if you want to make a ball spawn you need at least 10 points,anithing under that wont work,anithing above that will make a ball spawn and substract 10 points from your totoal.(on hit by laser)
number 2 :how to make ennemies die after 3 hits or so + when they die they add say.. 5 points.
number 3 :how to make ennemies comme towards an object in zero gravity.
sorry for all the questions
number 1 : how do you make a points work. example : if you want to make a ball spawn you need at least 10 points,anithing under that wont work,anithing above that will make a ball spawn and substract 10 points from your totoal.(on hit by laser)
number 2 :how to make ennemies die after 3 hits or so + when they die they add say.. 5 points.
number 3 :how to make ennemies comme towards an object in zero gravity.
sorry for all the questions
- hecta
- Posts: 21
- Joined: Thu Feb 02, 2012 3:39 am
Re: point system + game script help
"How to make a game if I don't know anything?"
Start from simple tasks, not from making complex games
Learn from forum demos and scripts.
Start from simple tasks, not from making complex games
Learn from forum demos and scripts.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: point system + game script help
if you have a scene.my.points as a point variable
then put in the oncollide of your ball spawner
scene.my.points>10?{here your spawn script;scene.my.points=scene.my.points-10}
same you can do for enemies, only then use controlleracc wich you do every time +1 if the enemy is hit
so in the oncollide (assuming all enemys have controlleracc 0):
controlleracc>5?{die}:{controlleracc=controlleracc+1}
last one, put a thruster or something or make a object in collision group J wich attracts the enemys
(put also a hidden object on the enemys)
then put in the oncollide of your ball spawner
scene.my.points>10?{here your spawn script;scene.my.points=scene.my.points-10}
same you can do for enemies, only then use controlleracc wich you do every time +1 if the enemy is hit
so in the oncollide (assuming all enemys have controlleracc 0):
controlleracc>5?{die}:{controlleracc=controlleracc+1}
last one, put a thruster or something or make a object in collision group J wich attracts the enemys
(put also a hidden object on the enemys)
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
-

monstertje3 - Posts: 343
- Joined: Sat Sep 05, 2009 4:29 pm
- Location: N-H, NL
Re: point system + game script help
thanks monsterje,realy helpfull
+klinich * i just dont know scripting much (I now bassics ) but with good info I could make a good game
+klinich * i just dont know scripting much (I now bassics ) but with good info I could make a good game
- hecta
- Posts: 21
- Joined: Thu Feb 02, 2012 3:39 am
Re: point system + game script help
the controleracc script does not work.I type controlleracc>5?{density=0}, but it changes it to controlleracc>5(?)({density=0}).why? 
- hecta
- Posts: 21
- Joined: Thu Feb 02, 2012 3:39 am
Re: point system + game script help
If you have an 'if', you must have a 'then' AND an 'else'. Therefore, {controlleracc>5} ? {density=0} : {};
Yes, I know I put "controlleracc > 5" in brackets--that's just the way I learned it.
If statement:
{Condition} ? {True} : {False};
Yes, I know I put "controlleracc > 5" in brackets--that's just the way I learned it.
If statement:
{Condition} ? {True} : {False};
-

TC42 - Posts: 984
- Joined: Sun Jan 09, 2011 1:53 pm
- Location: $ sudo apt get-install sandwich_
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests




