プレイ日記
Hudson awesomerobotguy
Does anyone know how to get sprites to move?
1そうだね
プレイ済み
返信[1]
親投稿
Autz sonic-HD8765
By manipulating variables that later will be used to locate the sprite onscreen: IF BUTTON(1) AND #RIGHT THEN INC PX IF BUTTON(1) AND #LEFT THEN DEC PX SPOFS 2,PX,PY
0そうだね
プレイ済み
返信[2]
親投稿
Hudson awesomerobotguy
NVM, I found a tutorial about moving. But I do need to know how to make a laser fire from a space ship.
0そうだね
プレイ済み
返信[3]
親投稿
Autz sonic-HD8765
That's also relative easy. If by laser you mean a big laser that goes into infinity: Just spawn it using the player coordinates. If you mean individual projectiles: Same as above but after spawn it, on each frame, increase the offsets of every single projectile so they will still move independently of the player.
0そうだね
プレイ済み
返信[4]
親投稿
Hudson awesomerobotguy
How exactly do I move a single bullet?
0そうだね
プレイ済み
返信[5]
親投稿
Autz sonic-HD8765
The most generic ones: - Using arrays (recommended). - SPOFS alone. Quick example: I check a certain range of sprites ID and check if one of those IDs is actually being used on a sprite. If there's a sprite with such ID, i extract his X and Y values (by using SPOFS), increase either X or Y, and relocating the sprite using the new coordinates.
0そうだね
プレイ済み
返信[6]
親投稿
Hudson awesomerobotguy
but that moves the bullet to one location. I need it to gradually travel across the screen.
0そうだね
プレイ済み
返信[7]
親投稿
Autz sonic-HD8765
Depends on how you implement it. The algoritm archieve that gradual movement, just visualize it: Let's suppose that the X value of a projectile which ID is 7 is 2 (X=2). On the first frame, X is increased by using the algoritm, now X is 3. Later on the next frame, the same algoritm is used, but since X is no longer 2 but 3, it will increase to 4, and so on...
0そうだね
プレイ済み
返信[8]
親投稿
Autz sonic-HD8765
Here's a dummy code i have on my stack. It used the algoritm i explained ealier.
0そうだね
プレイ済み
返信[9]
親投稿
Hudson awesomerobotguy
Thanks SO much, but I'm using a long beam instead. I will definitely use this for another project.
1そうだね
プレイ済み
返信[10]
親投稿
Stewart segludian1
SECXE2KE is my throw shovel demo, it might help.
0そうだね
プレイ済み