Help with a cannon
13 posts • Page 1 of 1
Help with a cannon
I'm making a cannon but I don't want to fire the bullets with magnets, and I want to add a 36 bullet limit
- mbartelsm
- Posts: 9
- Joined: Tue May 25, 2010 2:57 am
Re: Help with a cannon
Would be great not to read the entire tutorial
- mbartelsm
- Posts: 9
- Joined: Tue May 25, 2010 2:57 am
Re: Help with a cannon
Just read it. It'll help you in the long run.
TheWinkits wrote:They both looks of cuking amazing
-
Chronos - [Most Active Member 2010]
- Posts: 4457
- Joined: Mon Aug 31, 2009 6:00 pm
- Location: Californania
Re: Help with a cannon
I'll read it but in the mean time can anybody help me, I want to finish this soon
- mbartelsm
- Posts: 9
- Joined: Tue May 25, 2010 2:57 am
Re: Help with a cannon
never mind, but i have this and it doesn't create the tracers
I'm an idiot, i forgot the "pos := e.pos"
- Code: Select all
(e)=>{
scene.addcircle({
radius := 0.06;
density := 12;
pos := e.pos;
color := [1.0, 0.9763333, 0.29000002, 1.0];
drawcake := false;
attraction := -10000;
collideset := 64;
onhitbylaser := ((e)=>{attraction = 0})
});
scene.addpen({
size := 0.11;
color := [0.8580386, 0.8580386, 0.8580386, 0.175];
fadetime := 1.0
});
scene.addpen({
size := 0.1;
color := [1.0, 0.8333333, 0.0, 0.735];
fadetime := 0.4
});
scene.addpen({
size := 0.09;
color := [0.8580386, 0.8580386, 0.8580386, 0.37];
fadetime := 0.6
});
scene.addpen({
size := 0.08;
color := [0.8580386, 0.14300644, 0.0, 0.682];
fadetime := 0.1
})
}
I'm an idiot, i forgot the "pos := e.pos"
- mbartelsm
- Posts: 9
- Joined: Tue May 25, 2010 2:57 am
Re: Help with a cannon
mbartelsm wrote:Would be great not to read the entire tutorial
If you can't be bothered to put in any sort of effort why should we helps you.
@Chronos.
Don't just the Thyme tutorial card actually try and help.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: Help with a cannon
Your not exactly helping either.
In the code you need to specify the position of the tracers. Use;
For the nuber of bullets you need to create a varible.
eg;
Then create an if statement where if scene.my.bulletcount = 0 then it won't fire.
This should be the completed code;
In the code you need to specify the position of the tracers. Use;
- Code: Select all
pos := e.pos
For the nuber of bullets you need to create a varible.
eg;
- Code: Select all
Scene.my.Bulletcount = 36
Then create an if statement where if scene.my.bulletcount = 0 then it won't fire.
This should be the completed code;
- Code: Select all
(e)=>{scene.my.bulletcount == 0 ? {} : {scene.addcircle({
radius := 0.06;
density := 12;
pos := e.pos;
color := [1.0, 0.9763333, 0.29000002, 1.0];
drawcake := false;
attraction := -10000;
collideset := 64;
onhitbylaser := ((e)=>{attraction = 0})
});
scene.addpen({
pos := e.pos;
size := 0.11;
color := [0.8580386, 0.8580386, 0.8580386, 0.175];
fadetime := 1.0
});
scene.addpen({
pos := e.pos;
size := 0.1;
color := [1.0, 0.8333333, 0.0, 0.735];
fadetime := 0.4
});
scene.addpen({
pos := e.pos;
size := 0.09;
color := [0.8580386, 0.8580386, 0.8580386, 0.37];
fadetime := 0.6
});
scene.addpen({
pos := e.pos;
size := 0.08;
color := [0.8580386, 0.14300644, 0.0, 0.682];
fadetime := 0.1
})}
-
Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
Re: Help with a cannon
Thank you, i just didn't know how to create the "if"
- mbartelsm
- Posts: 9
- Joined: Tue May 25, 2010 2:57 am
Re: Help with a cannon
Okay, Does it work now?
If statements go like this,
{If}?{Then}:{Else}
> More than
< Less than
>= Equal to or More than
<= Equal to or less than
== Equal to
!= Not Equal to
If statements go like this,
{If}?{Then}:{Else}
> More than
< Less than
>= Equal to or More than
<= Equal to or less than
== Equal to
!= Not Equal to
-
Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
Re: Help with a cannon
Nxdt wrote:Okay, Does it work now?
If statements go like this,
{If}?{Then}:{Else}
> More than
< Less than
>= Equal to or More than
<= Equal to or less than
== Equal to
!= Not Equal to
You haven't put the {} around the statement.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
-
Matten - Posts: 435
- Joined: Mon Apr 05, 2010 2:03 pm
- Location: The Netherlands
Re: Help with a cannon
But for the sake of simplicity it is easier to teach them with the {} Not only that but it make your code easier to read and edit.
-
Mystery - Posts: 2802
- Joined: Thu Sep 03, 2009 1:16 pm
- Location: Southern Australia
Re: Help with a cannon
If people are inserting that into code then the curly brackets wouldn't be around the statement but around everything. People might assume that is right way to write the statement and mess up.
-
Nxdt - Posts: 1019
- Joined: Mon Aug 31, 2009 6:32 pm
- Location: Scotland!
13 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 14 guests