Hi
wonder if any of u out there can help me
Im struggling to use a variable power and repeat a script to move up or down that number of times
the POWER var is calulated by how long the space bar is held in
for example :
set POWER = 0
forever(if(space pressed)
{
change POWER by 0.25
}
the repeat script im failing with is below :
Repeat (round(POWER))
{
change Y by -5
}
Repeat Until ( Y > 50)
{
change Y by 5
}
appreciate any suggestions
Cheers
Offline
i only used the forever block for the If otherwise the if statement reguarding the space key press would not function
i understand what your suggesting is wrong but i stil dont kno how to solve the problem :S il keep at it thanks fullmoon
Offline
Jcater wrote:
i only used the forever block for the If otherwise the if statement reguarding the space key press would not function
i understand what your suggesting is wrong but i stil dont kno how to solve the problem :S il keep at itthanks fullmoon
Can you explain in a little more detail of what you want the sprite to do. I can maybe help.
Offline
<a href='http://scratch.mit.edu/projects/Jcater/1075423'><img src='http://scratch.mit.edu/static/projects/Jcater/1075423_med.png' width='425' height='319' alt='Scratch Project'></a> heres the project - very untidy and not functioning due to the repeat problem
Offline
thanks mate - im trying to make a sort of grabber game where your objectives are to get treasure to buy various material
main issue is the grabber itself i would like it to respond to the "power" variable : the amount of power generated by holding the space bar down
thanks much
Offline
Jcater wrote:
thanks mate - im trying to make a sort of grabber game where your objectives are to get treasure to buy various material
main issue is the grabber itself i would like it to respond to the "power" variable : the amount of power generated by holding the space bar down
thanks much
So you want the grabber to run faster if the power variable number is higher? Or do you want it to grab (variable power) times
Offline
yea i was hoping that the amount of power would determine how many times to loop around the script for making the grabber fall down then once the repeat loop exits it continues and brings the grabber back up to the ship
seems impossible to do it without a forever loop :S i may have chosen a not very nice method of doing this lol
thanks for the help btw
Offline
Jcater wrote:
yea i was hoping that the amount of power would determine how many times to loop around the script for making the grabber fall down then once the repeat loop exits it continues and brings the grabber back up to the ship
seems impossible to do it without a forever loop :S i may have chosen a not very nice method of doing this lol
thanks for the help btw
Okay I think i get what you mean. I think you are approaching this way harder that needed. I'll work with it a little bit and see if I can figure something out!
Offline
aw cheers mate - al give u a mention on the notes for helpin
donno if u ever played mario party mini game just like it - i'm hoping to make it into a sort of rpg similar to that mini game
oh n a noticed on ma script for taking the grabber up the y values should b negitive not positive - god so much mistake lol
Offline
Jcater wrote:
aww cheers mate yeah i see how it wud work fantastic !
![]()
actually a lot btter controlling in seconds as well
cheers saved many hours of frustration there hahaal go try tht now
Any time! If you need help just ask, I'll be glad to help!
Offline
Jcater wrote:
Great thanks again heres what Ive got so far
now gonny start on making it a playble game
http://scratch.mit.edu/projects/Jcater/1075423
The effects are great, and the final project will be great, but I think instead of all of what you did, you could do this.
Instead of this,
Do this,
You may have to make the grabber stop when it hits something
Hope you like this better!
Offline