プレイ日記
*J.P.*[P]£ aj2003aj
i need help making gravity, so the sprite will fall to the bottem of the screen instead of just staying like this, also if somebody also has a good jumping code that would be nice too (B= jump, or even up on dpad would work too) and one last thing, how can you tell a BG piece from an object in map. (if that was a dumd question, it was because some looked the same. thanks.
4そうだね
プレイ済み
返信[1]
親投稿
*J.P.*[P]£ aj2003aj
bottom, not bottem... ...good thing i dident accidentally say bottex, lol that would have been funny...
0そうだね
プレイ済み
返信[2]
親投稿
Josiah Spike4
This is my jump code-- Spset 0,0 @Loop if (button() and #B) && re==false then g=1:re=true if re==true then y=y-5+g:inc g,.12 if re==true && y>220 then y=220:re=false:g=1 spofs 0,150,y vsync goto @Loop
1そうだね
プレイ済み
返信[3]
親投稿
*J.P.*[P]£ aj2003aj
ok, ill go try that. thanks
1そうだね
プレイ済み
返信[4]
親投稿
*J.P.*[P]£ aj2003aj
i tried it but it did nothing... am i missing anything, or do i need something else to make it work?
0そうだね
プレイ済み
返信[5]
親投稿
*J.P.*[P]£ aj2003aj
forgot pic
0そうだね
プレイ済み
返信[6]
親投稿
Josiah Spike4
Your code can't reach the loop, it keeps going through the while and wend loop. If you put the code inside the @loop, loop, into the While-wend loop, it'll work.
0そうだね
プレイ済み
返信[7]
親投稿
*J.P.*[P]£ aj2003aj
...brb
0そうだね
プレイ済み
返信[8]
親投稿
Josiah Spike4
gtg
0そうだね
プレイ済み
返信[9]
親投稿
*J.P.*[P]£ aj2003aj
so i fixed it and now he jumps... ..but it seems that now he cant move anymore... poor random sprite... anyways. do you know what i need to do..? my idea is that the code that allows me to go up is whats the problem... probably wrong tho...
0そうだね
プレイ済み
返信[10]
親投稿
Aaron Krondelo
No offense but your code is a mess, in more than one way. You're mixing label loops and until, keep in mind your code will be stuck within those loops until the condition is met. You likely have one loop going and preventing other inputs. Write clean code and don't overcomplicate your code/loops. To make the sprite go down just put PY=PY+1. PY being in spofs 0,0,px,py.
0そうだね
プレイ済み
返信[11]
親投稿
*J.P.*[P]£ aj2003aj
i have no idea what you just said, but ok. and I haven't had this game for a long time (since sunday) and for now I don't care if the code is a mess, as long as it works... but if its causing it to not work then I can try to 'clean it', that's all the code I have right now other than the Press a to start code. (and print stuff)
0そうだね
プレイ済み
返信[12]
親投稿
*J.P.*[P]£ aj2003aj
ill look into more loop stuff, I think I misunderstood the part adout that...
0そうだね
プレイ済み
返信[13]
親投稿
Aaron Krondelo
Well, sorry it is hard to explain these things and word it well. But if you dont want my advice then I wont give it anymore. Messy code isn't about or like being a stickler for grammar, it will help you easier understand and decipher what the code is doing and why it isn't working.
1そうだね
プレイ済み
返信[14]
親投稿
Aaron Krondelo
Basically you have nested loops (loops within loops) that probably shouldn't be.
1そうだね
プレイ済み
返信[15]
親投稿
MSWS coolestkid123
Clean code is definantely important. This way if theres something you want to change, you know exactly where to go. Indenting is also handy to do I have a program that automatically indents). One last suggestion is don't make multiple big changes because if the program doesn't work you don't know what went wrong.
0そうだね
プレイ済み
返信[16]
親投稿
*J.P.*[P]£ aj2003aj
ok, so what is the other loop, its probably right in front of me... how about you tell me different types of loops, other than @loop. and maybe i can just change the walking code, the ones in the pic is more of a test than anything...
0そうだね
プレイ済み
返信[17]
親投稿
*J.P.*[P]£ aj2003aj
and yeah, not complaining about your advice, your advice is very helpful to me. the only thing is when i dont understand exactly what your saying, so im just try to either fix/change just the walking code. (or the loop if its just that simple...)
0そうだね
プレイ済み
返信[18]
親投稿
Josiah Spike4
Get rid of these lines of code @loop goto @loop once you do this, it will be in your original loop. Also have only 1 spofs that controls your sprite. Have that spofs but insert the y coordinates with the Y variable and the x coordinates with your variable that controls his x coordinates
1そうだね
プレイ済み
返信[19]
親投稿
*J.P.*[P]£ aj2003aj
ok ill do that thanks.
0そうだね
プレイ済み
返信[20]
親投稿
MSWS coolestkid123
Theres 4 loops that I know of. WHILE WEND Does it forever unless interrupted (BREAK, GOTO, END, etc) FOR A=0 TO X NEXT Repeats for X amount. REPEAT UNTIL (Expression) Like the WHILE loop, but runs once before checking if condition is TRUE. @A GOTO @A (Not suggested as it is sloppy). Basically WHILE WEND
0そうだね
プレイ済み
返信[21]
親投稿
Scientist Speedy1101
>>MSWS Did you make the auto-indenting program? Sounds useful.
0そうだね
プレイ済み