Discuss Scratch

Mehsonopra
Scratcher
2 posts

How to make a gun overheat and shoot slower overtime.

I'm trying to get a gun shoot slower overtime due to overheating and at a certain heat it completely stops shooting until the heat has dissipated. Here is my project if you want to have a better understanding of it.
Night time blitz
StrangeMagic32
Scratcher
1000+ posts

How to make a gun overheat and shoot slower overtime.

forever
if <<key [ key] pressed?> and <(Fire) = [1]>> then
change [ Overheat] by (1)
if <(Overheat) > [999]> then
set [ Can Shoot?] to [0]
repeat until <(Overheat) = [0]>
change [ Overheat] by (0.5)
set [ Fire] to [1]
end
end
wait ((Overheat) / (20)) secs
end
end

Last edited by StrangeMagic32 (Dec. 7, 2017 22:06:25)



“Remember the worth of souls is great in the sight of God;”
- Doctrine and Covenants 18:10


I have since moved to @JollyWinter
Mehsonopra
Scratcher
2 posts

How to make a gun overheat and shoot slower overtime.

StrangeMagic32 wrote:

forever
if <<key [ key] pressed?> and <(Fire) = [1]>> then
change [ Overheat] by (1)
if <(Overheat) > [999]> then
set [ Can Shoot?] to [0]
repeat until <(Overheat) = [0]>
change [ Overheat] by (0.5)
set [ Fire] to [1]
end
end
wait ((Overheat) / (20)) secs
end
end

Thanks for helping me, but after I put the program in, I realized it is not doing what I had in mind. I tried to see if it was something that I did wrong and I couldn't find anything, so I went back to this thread and realized that I phrased the request wrong.

What I tried (and failed) at describing was the rate of fire for the gun to slow down as it reaches its overheating point.

In other words, a guns rate of fire starts to slow down after it shoots, per say, 200 rounds then it starts decreasing its rate of fire as it nears its overheating point. And when it does reach its overheating point, you would have to wait to fire again until it has reached its idle temperature (this you had already added and it performs nicely). Think of an equation of (2^x)-1 on a graph and only look at the part in quadrant one. Lets set (0,0) on the graph to be the overheating point and the line be the rate of fire slowing as it nears (0,0). That is what I wanted but failed to describe.

I do not know how complicated it would be to make such a program, but I feel as if it can be done.

Thanks!

Last edited by Mehsonopra (Dec. 13, 2017 14:19:42)

StrangeMagic32
Scratcher
1000+ posts

How to make a gun overheat and shoot slower overtime.

Mehsonopra wrote:

StrangeMagic32 wrote:


Thanks for helping me, but after I put the program in, I realized it is not doing what I had in mind. I tried to see if it was something that I did wrong and I couldn't find anything, so I went back to this thread and realized that I phrased the request wrong.

What I tried (and failed) at describing was the rate of fire for the gun to slow down as it reaches its overheating point.

In other words, a guns rate of fire starts to slow down after it shoots, per say, 200 rounds then it starts decreasing its rate of fire as it nears its overheating point. And when it does reach its overheating point, you would have to wait to fire again until it has reached its idle temperature (this you had already added and it performs nicely). Think of an equation of (2^x)-1 on a graph and only look at the part in quadrant one. Lets set (0,0) on the graph to be the overheating point and the line be the rate of fire slowing as it nears (0,0). That is what I wanted but failed to describe.

I do not know how complicated it would be to make such a program, but I feel as if it can be done.

Thanks!
Okay I'll fix the code for the new info.


“Remember the worth of souls is great in the sight of God;”
- Doctrine and Covenants 18:10


I have since moved to @JollyWinter
StrangeMagic32
Scratcher
1000+ posts

How to make a gun overheat and shoot slower overtime.

forever
if <<key [ key] pressed?> and <(Can Shoot) = [1]>> then
change [ Overheat] by (1)
if <(Overheat) > [250]> then
set [Can Shoot?] to [0]
repeat until <(Overheat) = [0]>
change [ Overheat] by (-0.5)
end
set [Can Shoot?] to [1]
end
if <(Overheat) > [200]> then
wait ((Overheat) / (20)) secs
end
end
end

Last edited by StrangeMagic32 (Dec. 13, 2017 21:32:13)



“Remember the worth of souls is great in the sight of God;”
- Doctrine and Covenants 18:10


I have since moved to @JollyWinter

Powered by DjangoBB