トピック
受付中
Soan Soan_Sabishi

Destroying an enemy? EX7ALIEN

This is from the EX7ALIEN sample. I'm trying to understand how this works. I think "ED" means enemies dead? That's set to 0 at the start, but it seems to be set at -1 which means don't even print " ". Shouldn't it print if the enemy is dead? MD means "missile damage"? What does EDW mean then? What does SV mean and why do you subtract it? I know SC is score.
0そうだね
プレイ済み
返信[1]
親投稿
Oscar PwnageBlock
I've been studying this example code for a while... I can safely say this is an example on how NOT to code properly. No true significance in variable identifiers, a serious case of spaghetti code due to so many branching GOTOs (Using one GOTO/GOSUB is already a bad programming practice), and many other little things that worsen the quality of the code...
0そうだね
プレイ済み
返信[2]
親投稿
Oscar PwnageBlock
The game itself doesn't even have winning or losing conditions. You can't lose lives, and once all enemies die nothing happens. I'd wager this game was left incomplete at a very early stage of development, maybe because of its mostly unreadable, unintelligible code.
0そうだね
プレイ済み
返信[3]
親投稿
Soan Soan_Sabishi
You're right, but I'm just trying to understand how the code is making the enemies die when I play. The logic makes no sense to me. Implementing winning would be easy. Subtract 1 from the amount of enemies until it reaches 0. When the enemies reach the bottom, you can die. If they shoot you, you also can die.
0そうだね
プレイ済み
返信[4]
親投稿
Oscar PwnageBlock
Here's the logic for killing an enemy. It first tries to skip the kill logic by doing some conditionals. If it doesn't skip it, then it writes a space over the enemy, it sets the enemy state to -1 to set it as dead, and stops the shot. It would be much clearer with significant variable identifiers.
0そうだね
プレイ済み
返信[5]
親投稿
Soan Soan_Sabishi
Oh, that makes a little more sense. Indeed it would be. I wish they labeled what each variable actually meant. Instead, we have to guess what they mean. Still don't fully understand the whole SV thing. I know its related to score somehow. I watched PetitProffessor's video on this and he said ED meant "enemy direction". I thought it was "enemy dead".
0そうだね
プレイ済み