point system + game script help

About advanced scenes, and the Thyme scripting language used in Algodoo.

point system + game script help

Postby hecta » Wed Feb 08, 2012 5:20 am

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 :crazy:
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am

Re: point system + game script help

Postby Kilinich » Wed Feb 08, 2012 8:42 am

"How to make a game if I don't know anything?"
Start from simple tasks, not from making complex games :ugeek:
Learn from forum demos and scripts.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: point system + game script help

Postby monstertje3 » Wed Feb 08, 2012 8:47 am

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)
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.
User avatar
monstertje3
 
Posts: 343
Joined: Sat Sep 05, 2009 4:29 pm
Location: N-H, NL

Re: point system + game script help

Postby hecta » Wed Feb 08, 2012 2:57 pm

thanks monsterje,realy helpfull
+klinich * i just dont know scripting much (I now bassics ) but with good info I could make a good game 8-)
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am

Re: point system + game script help

Postby hecta » Mon Feb 13, 2012 12:49 am

the controleracc script does not work.I type controlleracc>5?{density=0}, but it changes it to controlleracc>5(?)({density=0}).why? :problem:
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am

Re: point system + game script help

Postby TC42 » Mon Feb 13, 2012 4:41 am

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};
Image
Spambot wrote:Nowadays, memes usually are studied less in the field of biology, but more with the arena of psychology along with sociology. But, the major area of a meme, getting embraced and imitated all the time is what’s at any core connected with any meme.
User avatar
TC42
 
Posts: 984
Joined: Sun Jan 09, 2011 1:53 pm
Location: $ sudo apt get-install sandwich_

Re: point system + game script help

Postby hecta » Mon Feb 13, 2012 4:47 am

thanks
:thumbup: :)
hecta
 
Posts: 21
Joined: Thu Feb 02, 2012 3:39 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 5 guests