プレイ日記
Scientist Speedy1101
I made a spaceship. It can move around the screen an shoot lasers when the A button is pressed. I would like to turn this into a game, but sprite collision is a problem for me. Should I use SPHITSP or test the X and Y values?
2そうだね
プレイ済み
返信[1]
親投稿
MSWS coolestkid123
SPHITSP
1そうだね
プレイ済み
返信[2]
親投稿
raimondz raimondzz
From my experience, SPHITSP doesn't work well when a rotation have been applied to a sprite. If your ship doesn't rotate, then you can use SPHITSP. Protip: SPHITSP(SPRITE1) always return the first that overlap SPRITE1, but SPHITSP() return the rest. You can do something like this: var SPHT=SPHITSP(LASER) REPEAT DAMAGESHIP SPHT SPHT=SPHITSP() UNTIL SPHT==-1
1そうだね
プレイ済み
返信[3]
親投稿
Scientist Speedy1101
Ok, but I had to rotate the laser sprite 180º to get it into position.
0そうだね
プレイ済み
返信[4]
親投稿
Scientist Speedy1101
I figured it out, but why does rotating the sprites mess it up? Maybe I'll just use more sprites.
0そうだね
プレイ済み
返信[5]
親投稿
raimondz raimondzz
Because the hitbox is always a rectangle and when you use SPROT the sprite is rotated but not the hitbox.
0そうだね
プレイ済み
返信[6]
親投稿
Scientist Speedy1101
Oh. Can that be rotated too?
0そうだね
プレイ済み
返信[7]
親投稿
MSWS coolestkid123
Yeah, just do SPHOME [SP #],8,8 This should fix it.
0そうだね
プレイ済み
返信[8]
親投稿
Scientist Speedy1101
Thanks, I'll try that.
0そうだね
プレイ済み
返信[9]
親投稿
raimondz raimondzz
mmm... that doesn't fix it. You only set the center point to the point (8,8) I made a clone of the battle system from undertale and discovered that issue with the collision. Here is the key: VENXE33J. Try to collide with the spears.
0そうだね
プレイ済み
返信[10]
親投稿
Scientist Speedy1101
K
0そうだね
プレイ済み
返信[11]
親投稿
Tuiridh V. Tuiridh
Thanks! This looks amazing, we need more shmups. Would be cool if L and R controlled each laser cannon.
1そうだね
プレイ済み
返信[12]
親投稿
Scientist Speedy1101
Great idea! I'll post (community post, not comment) a key once I have a shoot-the-enemy thing going.
1そうだね
プレイ済み
返信[13]
親投稿
Tuiridh V. Tuiridh
Awesome! This has real potential!
1そうだね
プレイ済み
返信[14]
親投稿
Scientist Speedy1101
I plan on making the ship customizable. I also plan on adding tracking missiles and making the enemy an actual enemy. Have you tried my program out yet?
0そうだね
プレイ済み