Discussions

SmileBASIC Community

SoanSoan_Sabishi

05/13/2016 8:15 PM ·Spoilers

Open Closed

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.

Advertisement

Comment

This post has no comments.

  • 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...

    Yeahs0
    Played
  • 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.

    Yeahs0
    Played
  • 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.

    Yeahs0
    Played
  • 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.

    Yeahs0
    Played
  • 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".

    Yeahs0
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-BXM-ZM9D-HE6-L8Y8

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: