トピック
受付中
Marcus MarcusPierce

Some Petit Computer questions

I am currently making a game using Petit Computer (SmileBASIC's predecessor) and I have ran into a few snags. This is one of my questions: 1. How do I make the enemy or player sprites react to a punch/kick? I've set the collision up where the sprites cannot move through one another but I cannot figure out how to push the sprites back with a punch/kick.
0そうだね
未プレイ
返信[1]
親投稿
Marcus MarcusPierce
There was not enough room for me to post all of my questions, so I will post the next one after someone answers my current inquiry.
0そうだね
未プレイ
返信[2]
親投稿
*J.P.* DEV NEWPICY3
well first: i dont know how different the code is in the previous version but ill try to help. so do you mean like knockback or like an animation? if its the first then i guess you could make it push him back in the direction he was punched using what the direction he was going in was (like if he punches and your last button press was left on the Dpad then move him right) hope this help..
0そうだね
プレイ済み
返信[3]
親投稿
Marcus MarcusPierce
To answer your question, I am talking about knockback. See, this is what my code looks like: GR=SPHITSP(G,R) IF GR==1 THEN GOTO @HITG @HITG SPOFS G,X,Y SPREAD(R),X,Y SPOFS R,X,Y I made it where they could not go forward once their collision boxes hit but I cannot seem to override it when I make P1 punch/kick.
0そうだね
未プレイ
返信[4]
親投稿
*J.P.* DEV NEWPICY3
hmm.. ill try to find something, the only command there I don't know is SPREAD. ill be back later lol..
1そうだね
プレイ済み
返信[5]
親投稿
Marcus MarcusPierce
SPREAD(or Sprite Read) checks what the current state of the designated sprite is ( in this case R) I use it so the two sprites' X & Y axis' do not get crossed.
0そうだね
未プレイ
返信[6]
親投稿
Marcus MarcusPierce
BTW, thanks for finding the time to help. I have had Petit Computer for several years now but I have really started to get into it in the last month or so. It has been quite the learning experience,lolol.
0そうだね
未プレイ
返信[7]
親投稿
*J.P.* DEV NEWPICY3
lol sorry i was very busy today, anyways if its stopping the player then you could maybe just change the players X (left or right) depending on it. i would usually use INC or DEC (idk if its the same) but what exactly stops the player? or i mean how does it stop him?
0そうだね
プレイ済み
返信[8]
親投稿
*J.P.* DEV NEWPICY3
lel oops i forgot what you said.. ok forget the last thingy. anyways if you can just INC the value say by .95 and dec that slowly it will create a sort of knockback look i think.. but yeah if there is a DEC/INC then i would use that
0そうだね
プレイ済み