プレイ日記
smashio XZelda-HolicX
i have a character(not a sprite) that i can move with buttons and a enemy that moves randomly. how do i do collision?
1そうだね
プレイ済み
返信[1]
親投稿
*J.P.* DEV NEWPICY3
im gonna say this fast. put the command SPCOL with the sprites mannagement number after it for every sprite you want to collide with, then use sphitsp with the two sprites you want to collide with and what to do, like this SPSET 0,0 SPSET 1,1 SPCOL 0 SPCOL 1 IF SPHITSP(0,1) THEN BEEP 50 put something like that in your code (without the spsets though lol) if done right it will beep when hitting.
1そうだね
プレイ済み
返信[2]
親投稿
Aaron Krondelo
No, for console collision just check if they are going to be in the same x,y coordinates.
1そうだね
プレイ済み
返信[3]
親投稿
eddie ninteneddie
You can check of the position of one character would collide with the other by asking if the character position will be equal. This is because character align to grid, unlike sprites, so there positions can really only be whole numbers. In your case a players X position 17.6 but this would be rendered on screen at position 18. It will be rounded to the nearest interger.
0そうだね
未プレイ
返信[4]
親投稿
Autz sonic-HD8765
You can use CHKCHR() that will return the character of the graphic screen at the given coordinates: IF CHKCHR(X,Y)=="Enemy" THEN 'Collision Take into account the drawing process, since if something overwrites the enemy character, this function will not return the enemy.
1そうだね
プレイ済み
返信[5]
親投稿
smashio XZelda-HolicX
how do i do it? cause i used print and locate.
0そうだね
プレイ済み
返信[6]
親投稿
smashio XZelda-HolicX
how do i check a character or letter?
0そうだね
プレイ済み
返信[7]
親投稿
*J.P.* DEV NEWPICY3
oh for letters just take the enemy x,y and the players x,y then make an if IF PX==EX AND PY==EY THEN (collision stuff)
0そうだね
プレイ済み
返信[8]
親投稿
Hanzo rzsense
Use Autz's method, but return value of CHKCHR is integer type (not string type). To check presence of letter or character at X,Y on console screen, do as follows. IF CHKCHR(X,Y)==ASC("(letter or character)") THEN ...
1そうだね
未プレイ
返信[9]
親投稿
Autz sonic-HD8765
^ Oh, i forgot that detail. You can also use CHR$().
1そうだね
プレイ済み
返信[10]
親投稿
crazy pro Jakob13009
i made a game like that where there is a figure that you can move around
0そうだね
プレイ済み
返信[11]
親投稿
Stewart segludian1
If the enemy is at ex, ey and the player is at px, py, just check if ex == px and ey == py. Demo attached.
2そうだね
プレイ済み
返信[12]
親投稿
smashio XZelda-HolicX
Thanks everyone.
1そうだね
プレイ済み