New Feature - Super Binary Man: basic ai

in #utopian-io6 years ago (edited)

Super Binary Man

New Features

  • added an enemy class from which all future enemies will inherit from
  • implemented the first enemy called "Dumdum".
  • introduced sprite-sprite collision
  • added a basic life system
  • added a level-reset capability
  • changed the level layout a bit
  • changed the warp system
    photo of basic-ai update
    play the new version here
    note that you may have to clear your browser's cache

Implementation details

  1. collision system
    • The new collision function (as seen here simply checks whether two sprites are overlapping, when called, if it returns true the level will reset at shown at this line
      Link to relevant lines in the code on GitHub and explain briefly what you added/changed.
  2. Enemies
    • The new enemy class can be seen here. It inherits from the Sprite class, and is very similar to the player class except it's meant to be controlled by a game ai.
    • Dumdum is the first enemy in the game as seen here. It begins by choosing a random direction and speed. There is a small chance at every game tick that it will change its direction and speed. There is a medium chance of it changing direction and speed when a player hits the wrong block. It can warp around the screen like any sprite. It does not chase the player.
  3. Warp system
    • The warp function has been moved to the Sprite class as seen here. As you can see from the code, warping is now done in an anti parallel configuration which makes predicting enemy movements while under stress more difficult and also allows for more effective dodging at certain situations.
    • The level layout has been changed to accommodate the new warp system as seen here.
  4. Level reset
    • A level reset function now includes a call to resetBlocks. It accepts a single argument (either true/false) for whether to decrease the player's life. You can see the code here
  • The level reset also takes care of calling the gameOver state



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey, this is neat! Would be a doodle in Godot and you could export to Browser!

I'd love to make my next game in Godot. This game though I'm really enjoying writing a simple game framework along with the game. Hopefully when I move to Godot this will be useful experience. Thanks for the kind comment

Do you mind me asking, did you post this as a tutorial or blog?

I meant for this to be a new feature under the development category. Thanks for pointing out the confusion. I updated the title.

As per the Updated Utopian rules "The repository must contain a readme file with usage and install instructions, as well as an appropriate open source license.", please update your README.

The README has been updated. Thank you for your time.

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @netanel-m I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.24
TRX 0.11
JST 0.031
BTC 61585.79
ETH 3005.19
USDT 1.00
SBD 3.68