Discuss Scratch

Firedrake969
Scratcher
1000+ posts

How to save location?

On my project here, it's supposed to save the area, but when the page is refreshed, it doesn't. I can't figure out why….

Another problem I have, possibly related, is that when I (the green sprites) click, the bullet (green) doesn't fire like it's supposed to. Ideas?

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
ErnieParke
Scratcher
1000+ posts

How to save location?

Wait, what do you mean by saved? As in the stage is laid out the same way as when you were last there? Or saved, as in a game file?

Anyway, I don't have much time now, so I'll have to instead stop by tomorrow, when possible. ;)

Reassurances,

ErnieParke

Firedrake969
Scratcher
1000+ posts

How to save location?

No problem!

I'm mostly talking about saving the X/Y pos, the tank direction, and the tank's area (as in which background it's on, kinda).

If you need me to clarify, I can write a bit more.

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
firedrake969_test
Scratcher
500+ posts

How to save location?

bump

Alt account of Firedrake969.

Rocket II: A black and white bitmap space game!

I seek not fame, but education.

;
ErnieParke
Scratcher
1000+ posts

How to save location?

firedrake969_test wrote:

bump
Oppps… This seems to have slipped my mind for a few days. I'll stop and look quickly, but I'll have to deliver the verdict tomorrow. That I will promise. ;)

For certain,

ErnieParke

P.S. Just a quick question about this:



Why is there a <not <>> around the two boolean slots checking your username?

Edit: I understand now.

Last edited by ErnieParke (Oct. 14, 2013 00:23:06)


ErnieParke
Scratcher
1000+ posts

How to save location?

I just looked through, and with only editing your username block to allow me to test, I was able to shoot easily, as long as I was on the grass plains. Elsewhere, you're not updating the tank's environment in the cloud variable/list, so your game is blocking any shooting.

As for what's happening with your stored locations, I noticed something:



Do you see those if/else's? Why do you even have them? Yes, I understand that you're trying to store negative values in a cloud variable/list, but you're not doing it correctly. The formula is:

((round (scratchblocks)) + (480))//Or something around 480.

Not:

(((-1) * (round (scratchblocks))) + (241))//And...
(round (scratchblocks))

The problem with what you have is as you move right in the negative x-positions, the listed value (in your cloud list) decreases. As you move right in the positive x-positions, it increases. They're backwards from each other. The same is true with your y-values.

Do you see where I'm coming from? By the way, this might not be the only bug in your position not being saved (I can't test too far thanks to not being white-listed…), but I think it's one of them.

Thoughts,

ErnieParke

Firedrake969
Scratcher
1000+ posts

How to save location?

Would the same be true for the dirCheck block?

EDIT: I may not respond for a while, because I'm on vacation.

Last edited by Firedrake969 (Oct. 14, 2013 03:34:26)


'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549

Powered by DjangoBB