I'm trying to make a 1s1s where the score is displayed as you're playing, not just when you die. The problem is, as you can imagine, it's laggy to the point where it's unplayable. Can anyone think of any way to make the score display while the user's playing while keeping it playable? Thanks. The project can be found here.
Last edited by RedRocker227 (2012-04-21 14:13:00)
Offline
zammer990 wrote:
Your game constantly switches costume sand has to so that'd be laggy anyway. To display score simply set the variable to visible
Without the score it's only laggy in editing mode - in full-screen and online it doesn't lag in the slightest. And I'm not a fan of making variables visible, they look messy in my opinion (it would look especially messy in this one, since it wouldn't fit the theme at all).
Offline
I think the reason that it is lagging is because there are three stampings at a time. The ball and paddle are both changing at the same time, the program can't process it, and that creates a "hide-show" on and off effect. Adding the score just adds to the problem, making the computer stamp three things almost at once.
I don't think anything is wrong with the scripting--I thinks that's fine, but continuos stamping causes the lag. There are a few 1s1s games I have seen that use different costumes as sprites, but not having them stamp multiple costumes at different times.
I would suggest a more intervalled (or however you spell it ) timer for stamping (like every 5 seconds), or just create a time variable (or timer) to be shown how much time you went before you lost.
My number 100 post!!!
Offline
mythbusteranimator wrote:
I think the reason that it is lagging is because there are three stampings at a time. The ball and paddle are both changing at the same time, the program can't process it, and that creates a "hide-show" on and off effect. Adding the score just adds to the problem, making the computer stamp three things almost at once.
I don't think anything is wrong with the scripting--I thinks that's fine, but continuos stamping causes the lag. There are a few 1s1s games I have seen that use different costumes as sprites, but not having them stamp multiple costumes at different times.
I would suggest a more intervalled (or however you spell it ) timer for stamping (like every 5 seconds), or just create a time variable (or timer) to be shown how much time you went before you lost.
My number 100 post!!!
That's a great idea! The one where it only stamps the score every, say, one second, that is. I'll test it later.
Offline
Ugh, it doesn't work. I didn't think of the fact that since it clears the screen at the start of every "iteration" (right word?), if it only stamps the score every, say, ten iterations, the score will still be flashing loads. Anyone got any other solutions?
This is RedRocker by the way.
Offline
I was looking at your script and I saw "repeat (length of(score) )" and I immediately thought "well, that's probably the problem". The inherent delay in the repeat block is what is causing the lag (I removed it and it is fine).
I hate to say it, but I think you have to replace that loop with a ton of if statements. It means that the score thing will glitch (eventually), but using a loop is really just too slow
if(length > 1)
{
print first letter
if(length > 2)
{
print second letter
if(length > 2)
{
etc.
}
}
}
Offline
MoreGamesNow wrote:
I was looking at your script and I saw "repeat (length of(score) )" and I immediately thought "well, that's probably the problem". The inherent delay in the repeat block is what is causing the lag (I removed it and it is fine).
I hate to say it, but I think you have to replace that loop with a ton of if statements. It means that the score thing will glitch (eventually), but using a loop is really just too slow
if(length > 1)
{
print first letter
if(length > 2)
{
print second letter
if(length > 2)
{
etc.
}
}
}
I'm probably just being incredibly dumb, but I don't see how that differs from the current script (apart from the block structure, obviously) - it'd still repeat the same amount of times, and it'd probably even take longer, since it needs to check the boolean every time it runs. Can you explain why that'd be better than the current method? (I'm gonna look so stupid when I realise it, haha)
Offline
RedRocker227 wrote:
I'm probably just being incredibly dumb, but I don't see how that differs from the current script (apart from the block structure, obviously) - it'd still repeat the same amount of times, and it'd probably even take longer, since it needs to check the boolean every time it runs. Can you explain why that'd be better than the current method? (I'm gonna look so stupid when I realise it, haha)
Basically, every "C" block has a slight delay built in. If you have a project with this:
when gf clicked go to x:(0) y:(0) forever change x by (3)The sprite won't immediately zoom right across the screen because there is a very slight delay between the finishing of the execution of the "change x" block and the looping back to the top of the loop. One of the main things that turbo mode does is eliminate this slight delay.
Last edited by MoreGamesNow (2012-04-21 17:10:49)
Offline
MoreGamesNow wrote:
RedRocker227 wrote:
I'm probably just being incredibly dumb, but I don't see how that differs from the current script (apart from the block structure, obviously) - it'd still repeat the same amount of times, and it'd probably even take longer, since it needs to check the boolean every time it runs. Can you explain why that'd be better than the current method? (I'm gonna look so stupid when I realise it, haha)
Basically, every "C" block has a slight delay built in. If you have a project with this:
when gf clicked go to x:(0) y:(0) forever change x by (3)The sprite won't immediately zoom right across the screen because there is a very slight delay between the finishing of the execution of the "change x" block and the looping back to the top of the loop. One of the main things that turbo mode does is eliminate this slight delay.
Back to your code. Putting it all in "if" blocks means it doesn't have to go through a loop, so it won't have that delay.
Edit: you should put a strikethrough through your forum's name
Ah, gotcha.
I was right, I do feel stupid, haha.
Thanks.
Offline
Bump. I'll try ^that^ method later, but I'm still open to more methods. ;P
Offline
How about instead of having the paddle glide, have it change,say, 15 x-pos every time the arrow is pressed? It wouldn't make it smoother (it would be a little choppier), but I don't know if it owuld stop the glitching. :\
Offline
^It already did that.
And MoreGamesNow's method worked. Thanks, MoreGamesNow.
Offline
RedRocker227 wrote:
^It already did that.
And MoreGamesNow's method worked. Thanks, MoreGamesNow.
I live to serve
Offline
RedRocker227 wrote:
zammer990 wrote:
Your game constantly switches costume sand has to so that'd be laggy anyway. To display score simply set the variable to visible
Without the score it's only laggy in editing mode - in full-screen and online it doesn't lag in the slightest. And I'm not a fan of making variables visible, they look messy in my opinion (it would look especially messy in this one, since it wouldn't fit the theme at all).
If you don't like the messy variables, try to first add ten costumes:
Costume 1: The Number One
Costume 2: The Number Two
Costume 3: The Number Three
Costume 4: The Number Four
Costume 5: The Number Five
Costume 6: The Number Six
Costume 7: The Number Seven
Costume 8: The Number Eight
Costume 9: The Number Nine
Costume 10: The Number Ten
Secondly, add the scripts. Use whatever scripts necessary in your project, just make sure to use stamping if you want your project to be 1s1s.
Offline
darthvader111 wrote:
RedRocker227 wrote:
zammer990 wrote:
Your game constantly switches costume sand has to so that'd be laggy anyway. To display score simply set the variable to visible
Without the score it's only laggy in editing mode - in full-screen and online it doesn't lag in the slightest. And I'm not a fan of making variables visible, they look messy in my opinion (it would look especially messy in this one, since it wouldn't fit the theme at all).
If you don't like the messy variables, try to first add ten costumes:
Costume 1: The Number One
Costume 2: The Number Two
Costume 3: The Number Three
Costume 4: The Number Four
Costume 5: The Number Five
Costume 6: The Number Six
Costume 7: The Number Seven
Costume 8: The Number Eight
Costume 9: The Number Nine
Costume 10: The Number Ten
Secondly, add the scripts. Use whatever scripts necessary in your project, just make sure to use stamping if you want your project to be 1s1s.
He already made the game.
Offline