lololol
btw i am making a text based version of minecraft its still in production but it is going to be out soon. maybe two weeks to two and a half weeks
Cameron Stover VVVVVVVVVVVVVV ALSO VVVVVVVV and i like trains (BOOM!) also minecraft and trollface!
INFECTED. NEW ZOMBIE
is it possible to assign a string name to a sprite? i've tried assigning a string to a sprite, using SPSET, but it hasn't worked out. if it is possible, how do i go about doing it? example?
KAHN
3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12
is it possible to assign a string name to a sprite? i've tried assigning a string to a sprite, using SPSET, but it hasn't worked out. if it is possible, how do i go about doing it? example?
probably not, my theory on the way it is only numbers is because it is faster to type a number than a whole string.
why would you want to do that anyway?
So what if there's no Mega Mans in Metroid?
That doesn't mean we can't have metroids in Mega Man.
programming, son.
more specifically, remember when i asked about moving "===" (post #1,334)? well, i just began translating the program so the paddle is instead a sprite (#64) wandering around a virtual environment. i wanted to name the sprite with a string so i could refer to it as R1$. it didn't REALLY need to be a string, just any kind of label would have worked.
KAHN
3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12
programming, son.
more specifically, remember when i asked about moving "===" (post #1,334)? well, i just began translating the program so the paddle is instead a sprite (#64) wandering around a virtual environment. i wanted to name the sprite with a string so i could refer to it as R1$. it didn't REALLY need to be a string, just any kind of label would have worked.
You could always use a named constant for a sprite's control number. It would work just as well as a label would.
Ex.
BOUNCING_DEMON=23
well, i ended up wimping out on that and used SPOFS. the program runs well, but the character only animates (used SPANIM for animation when he walks) when i release the D-Pad, and by then he isn't walking anymore, so it doesn't makes sense. when he does move, there's no animation, and it's incredibly slow. i'm trying to fix it, but i don't know how it'll end up going faster.
KAHN
3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12
The "walking without moving" thing could be caused by using SPANIM in a loop, every time you set the animation, it restarts.
Since you're setting the animation several times during a loop it restarts several times very quickily and it looks like the character is not animated at all... Until the loop ends and the animation is free to go on.
i havent been on a while and i have a few q and c's. @bigdog00 just use the wikia,plz. you are about the only person who can use those qr codes
i need help with things. 1. i am trying to make a Beyblade spinoff on BASIC(yay).anyway how would i do the random movement? so far all i can do is make it follow my players beyblade.2. i am also making an rpg ecause the rpg's i have seen are good, but they have no storyline. how would i do something like a pokemon battle? it seems really complex in my head. last thing. everytime i make a sprite walk, it walks to a definite place. i am the one controlling it. how do i make it keep moving?.ok. info would be appreciated. Thank you.
Using names for sprites would make the code larger. I'm fine using plain numbers.
Using numbers also makes it easier to work with several sprites at once, imo.
That's because you're so smart, numbers don't trip you.
The reason variable names are preferred is because you can change it right at the top, and the whole code is modified. In other words: Maintainability. What if you want to change the sprite? You can have PADDLE=95, and have every PADDLE instance changed, or you can search for every "95" value in the code, and double check that is paddle, instead of something else. This is very helpful when your program goes large. For 500 lines or less program, then yeah, numbers don't matter. But what you're advocating is the use of "magic number" and that's bad programming practice.
In some circles, even the use of variables I,J for loops is discouraged. For example
FOR I=0 to 191:FOR J=0 to 255
is considered bad. The preferred style would be
FOR Y=0 to MAX_Y:FOR X=0 to MAX_X
This is only relevant if you ever want to work as a computer programmer, but it's good to keep in mind even when you're a beginner.
Wait, were we talking about sprites or sprite characters?
well, if by sprites, you mean the command, and by sprite characters, you mean the sprites you see on the screen, then i was talking about the sprite command.
KAHN
3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12
Forums
Topic: Petit Computer
Posts 1,401 to 1,420 of 9,620
Please login or sign up to reply to this topic