SPAMPIG Minigame for Crypto GameHUB
Note: This gif has been sped up to compensate for a small file size as well as demonstrating the core mechanics.
Details
We (Wearecodex) have conceptualized our next big project and SPAMPIG will be the first step towards our goal.
SPAMPIG will be the first minigame to be implemented once Crypto GameHUB is developed.
In SPAMPIG you're in control of a spammer pig, your objective is to feed him flags and avoid upvotes.
Every minigame will contain a moral and revolve around that moral. The moral of SPAMPIG: The only attention spammers/trolls must be fed with are flags.
How to play
The objective is to catch as many flags and avoid providing the piggy with upvotes
The player is required to maneuver the piggy with the mouse to fulfill the objective accumulate flags.
How was it done?
There are 2 core mechanics present in this version, the objects & the pig.
The first core mechanic being the pig's movement.
All that's done is updating the pig's position to the position of the mouse.
private void Update()
{
UpdatePosition();
}
private void UpdatePosition()
{
transform.position = Utility.MousePos;
}
The second core mechanic is the interactable object's movement.
For this mechanic a Rigidbody2D component must be present in our object so it's subject to physics. Next we need to reverse gravity so everything has a upward pull.
Once the object is generated we will add a downward force to it to propel it downwards so the reversed-gravity will do it's job once the force has worn off.
public override void Shoot(float force)
{
rb.AddForce(Vector2.down * force, ForceMode2D.Impulse)
}
It is also imperative to make sure the object is detrimental when a upward velocity is present as well as destroying the object when it exceeds the upper boundary of the screen.
private void Update()
{
if (rb.velocity.y > 0 && objectType != Type.HOSTILE)
Transform();
if (rb.velocity.y > 0 && transform.position.y >= Utility.ScreenHeight)
Destroy();
}
How to install or modify
First you'd need to download the project from repo: https://github.com/wearecodexx/crypto-game-hub
How to Install:
Upload "UnityBuild" files to your web server or local server.
Open the index.html file.
How to modify:
You're required to install unity if you wish to modify this project, as this game is developed with Unity & C#.
After you've installed Unity all you've got to do is open the "UnityProject" folder with Unity.
Workspace
Roadmap
- Sound effects and background music
- Different types of flags/different points to score
- Don't upvote mode. Only upvotes will fall and you have to move the pig to avoid them, score will show time instead of points.
- Add variety to gameplay by introducing different objects & mechanics.
- Design and integration of custom loading and splash screens.
Link to the game:
https://wearecodex.com/games/spampig/
How to contribute
If you wish to contribute to the project please contact @fabiyamada or feel free to join our discord server to discuss it further https://discord.gg/8ZNq3Ss.
Posted on Utopian.io - Rewarding Open Source Contributors