Manuals – Gamcore https://gamcore.alloxesinfotech.com Game Zone Wed, 19 Mar 2025 05:44:07 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 https://gamcore.alloxesinfotech.com/wp-content/uploads/2025/02/cropped-gamcore-logo-1-32x32.png Manuals – Gamcore https://gamcore.alloxesinfotech.com 32 32 How to Create an Adult Game, Part 2 https://gamcore.alloxesinfotech.com/game/manuals/how-to-create-an-adult-game-part-2/ https://gamcore.alloxesinfotech.com/game/manuals/how-to-create-an-adult-game-part-2/#respond Sat, 12 Oct 2024 18:42:36 +0000 https://gamcore.cm/?p=125 Hi everyone ?

I’m a long time adult game developer, (I love my job) In this tutorial we will learn how to make an adult game from 0, I accepted a challenge to create a Tutorial so that anyone without the need for programming knowledge can develop it, and take what has been learned as a basis to develop future games, We will learn from the Download of the chosen Engine, until the publication of the game, You can find out more about me through my Patreon

Creating a scoring system!

(Working with UI and goals!)

Step 1- Now we need a scoring system to set a goal in the game, the goal of this game will be to find and have sex with 4 girls in the level to open a door to the next level.

For this we will need a Score counter, so we will create our first UI, this step is very important because a UI will be used in almost any game you create, so pay close attention!

Let’s start by creating a Canvas which is a screen where all the elements of our UI will be, go to  the Hierarchy  tab and right click, go to UI, then to Legacy and choose the Text  option (I like to use the Legacy version of the texts, but you can also use the new version) after that you will see that it automatically created a Canvas and our first text is inside, set the name of that text to Score.

Now go to  the Hierarchy  tab and click on our text Score and press the F key, this will center the position of our text on the screen (Yes it looks huge) now scroll the mouse scroll until you see all the space of the Canvas in  the Scene tab, you will see that our first text is in the bottom left corner of the Canvas,  if you go to the Game tab you will see the same, And so we created our first UI!

Here’s an example:

Create a first UI in Unity GIF
Create a first UI in Unity GIF

Step 2- Now let’s edit and make our UI more beautiful, in the Hierarchy tab, click on the Score text  that we just created, and go to the Inspector tab, you will find a typing field with the name Text, this is where we will edit the text that will appear in the game interface, rename this New Text field  to 0,  in this same tab you will find the Best Fit option, check this option so that the text fits to a specific scale, and then in  the Color field, click and select the white color  and that’s it!

We already have a score marker that initially starts as 0, but we also need a marker for the goal, so let’s get to it!

In  the Hierarchy tab, in the text Score, right-click on it and go  to Duplicate (Or use the shortcut Ctrl + D for this) Right click on the new text Score (1), and go to Rename (or click on the shortcut F2) and rename it to Goal, now go to the inspector tab and rename the text to /4, in our scenario, move the text we just created (Goal) next to the Score text. Then select the 2 texts we created (be careful not to select the Canvas) and place them in the upper left corner of the canvas!

Here’s an example:

Create a Goal in Unity GIF
Create a Goal in Unity GIF

Step 3- Now we need to make all of this controlled and functional, and not just something visual!

To do this, create a new script that will control this type of function in the game, create the script with the name of GameManager and open it.Very important step, every time you control a UI by Script, you will need to add the following line at the top, just below (using UnityEngine;)

using UnityEngine.UI;
using UnityEngine.UI
using UnityEngine.UI

Now below the first one ({) add:

public int score = 0;
public Text txtScore;
public static GameManager instance;
GameManager
GameManager

The variable (score) will always start as 0, which will define the amount of points that the player will have made. Now in the (void Update()) under the first ({) add:

txtScore.text = FindObjectOfType<GameManager>().score. ToString();
GameManager Scoring
GameManager Scoring

All ready in this Script, just save it!

Now let’s go back to Unity and open the FirstGirl script to add the function that will add points, in the (void Update()) after the line (handjobAnim.SetActive(true);) add:

FindObjectOfType<GameManager>().score += 1;
GameManager Score increase
GameManager Score increase

Okay, now save the script and go back to Unity, once this is done click and drag the newly created GameManager  script to the MainCamera in  the Hierarchy  tab to add the script to the scene camera, it will look like this:

GameManager Script in Unity
GameManager Script in Unity

Notice that we are missing an object in  the Txt Score field, go to  the Hierarchy  tab and drag the text Score into the field, it will look like this:

GameManager Script Txt Score
GameManager Script Txt Score

Ready! Now the result should look something like this:

Game Score System in Unity GIF
Game Score System in Unity GIF

Creating a Game Over!

(Transitioning scenes and initiating challenges!)

Every game needs a game over, and basically for our game it will be no different, we are going to make a drop system for the player, where if he falls into a hole or map limit, a game over screen will appear and it will be necessary to start the map again, with this we will learn how to create Scenes for our games and make the transition between them through any command!

Step 1- Let’s create a new scene for Game Over, but first save your project using the shortcut Ctrl + S, then go to  the Project  tab and in  the Scenes  folder right click, Create and then in Scene, put the name of gameover.

Scenes in Unity

Now let’s go into our new scene, just double-click on it, you’re done! Our new scene is created! This same procedure is for creating new maps for your game in addition to a main menu as well!

Step 2 – Let’s now go to the designer of our new scene, we will need a text and a new canvas for this, in  the Hierarchy menu, right click and go to UI, then Legacy  and then Text, Now using what we have already learned create a very large name in red written Game Over.

It should look something like this:

Game Over Screen

Now go to the Hierarchy tab, click on  the Main Camera and go to  the Inspector, change the Background  property to a black color, then once again create a new text using what was learned just below the small and centered Game Over with white color and with the text (Press E to try again) go to the Game tab and see the result!

It should look something like this:

Game Over Screen 2

Now let’s create our script to make this screen work! Go to the scripts folder and create a Script with the title gameover and open it.The first thing we have to do when we are going to control scenes through scripts, we need to add a new library to Unity, for this in the script, just below using UnityEngine; Add:

using UnityEngine.SceneManagement;
Unity Engine Scene Management

Now in the void Update() below the first ({) add:

if (Input.GetKeyDown("e"))
{
  SceneManager.LoadScene("SampleScene");
}

Note that the name SampleScene is the name of the scene we want to access as soon as we hit the “e” button, but you can change the scene name to the name of any scene in your project and use that same command!

Now save your script, go to Unity and drag the gameover script to the Main Camera in  the Hierarchy menu, that’s it, you can try it now!

Step 3- Let’s now create the player’s death, save your game using the shortcut Ctrl + S and in  the Project tab, open the game scene (SampleScene) back to our main scene, we will need to create a hole for the player to fall and die, in  the Hierarchy menu click on Ground and press the F key to center (Or use the mouse scroll for this).

Let’s now delete a square from the floor (Ground1 (7)) or whatever you choose, let’s decrease the size of the Base object and duplicate it to create the base on the other side, position the new Base on the other side and that’s it (I’ll show you in the example) Next, we’re going to duplicate the Base one more time, and we’re going to position the new Base at the bottom of the floor, where the player will fall (this base already contains a box collider so it will already advance much of the process).

Now go to the Inspector  tab of this new Base and click on Layer Ground, go to Add Layer... and then add a new field with the name gameover, go back to the Hierarchy menu, click on the Base again, and change the Layer to gameover.

Here’s an example:

Creating a death in Unity Game GIF
Creating a death in Unity Game GIF

Now to finish the aesthetic part, rename this new base to (death) go to  the Inspector tab and in Color change the value of A (Alpha) to 0!

Scene Alpha Opacity in Unity

Now we can use this object (death) to create all the death points in the game!

Step 4- Let’s now go to the Script, open the Player script, remember that whenever we use commands to change scenes we need to add a new library? So let’s go!

Just below using UnityEngine; Add:

using UnityEngine.SceneManagement;
Unity Engine Scene Management
Unity Engine Scene Management

Agora na private void OnCollisionEnter2D(Collision2D collision) antes do último (}) adicione:

if (collision.gameObject.layer == LayerMask.NameToLayer("gameover"))
{
   SceneManager.LoadScene("gameover");
}
Unity LoadScene Script
Unity LoadScene Script

Basically what we’ve done here is that when you tap on an object that has a collision and that has the gameover layer, a new scene will load.

Now save your script, go to Unity and let’s add the scene to the scene list, in the top left corner of Unity, click on File, then on Build Settings... With this window open, go to the Project tab and the Scenes folder, click and drag the gameover scene to the list.

Here’s an example:

Adding Scene to the List in Unity
Adding Scene to the List in Unity

Now close the window and test the game!

Camera following the player!

(Working with Camera Scripts)

It’s a simple but very important step for platformers, and you’re sure to use this system in countless games you can create!

Create a Script with the name CameraController and open it, then under the first ({) add:

[SerializeField]
private Transform target;
Unity Camera Controller
Unity Camera Controller

And finally, in the void Update() after the first ({) add:

transform.position = new Vector3(target.position.x, target.position.y, transform.position.z);

Save your script, and then go back to Unity, click and drag the CameraController script into the Main Camera in  the Hierarchy tab, click on  the Main Camera and you’ll notice that the script in the inspector will be asking for an object like Target, in  the Hierarchy menu, click and drag the Player into that slot.

It will look like this:

Unity Camera Controller Transform
Unity Camera Controller Transform

Now in the Main Camera Inspector, look for Size, and change it from 5 to 3 and test the game!

It should look like this:

Work on the game camery in Unity GIF
Work on the game camery in Unity GIF

Very good! Since we’ve learned everything we needed to build our first game, let’s move on to the next step!

Putting it all into practice!

(Assembling the first map and final objective)

Step 1 – Now let’s put everything we’ve learned into practice, duplicate and add new objects and create a starting map of your choice, don’t forget to also add + 3 girls to the game (following the same steps we used to create the first girl) this will be important for us to achieve the goal of 4 girls!

Also don’t forget to create a kill for the game, holes and platforms for the player to jump on, be creative!

There’s also the option to just proceed with the short map we’ve made so far, just add the 3 girls and let’s keep going!

Here’s the map I made using just the steps in this tutorial:

The complete scene

Notice that I added the girls to the game, they are in the Characters folder and their sexual animations in the Animations folder, Here’s the location of each one:

The complete scene with girls locations

The final goal is just to have sex with the 4 girls, so at the end we will have a “Congratulations” screen or you can create a second map using the tutorial to create a more difficult level!

Step 2- Let’s create our final screen, go to  the Scenes folder in the Project tab and create a new scene, Right click, Create and then in Scene, put the name of Final.

Save the project before entering the new scene, use the shortcut Ctrl + S, now enter the new scene and let’s assemble it.

In the Hierarchy tab, create a text very similar to the Game Over text we created before, but with the text "Congratulations!" and set the color to yellow, then create smaller text underneath with the text: "Press E to play again" 

It should look like this:

The Congratulations Scene

Now we won’t need to create a script for this scene, because the intention is to restart the map as soon as the player presses E, then we can use the same Gameover script for this, if you want this screen to take you to a second map, just copy the gameover  script and change the name of the called scene to the name of the scene of the second map!

Click and drag the gameover script into the Main Camera in the Hirarchy  tab and you’re done!

Now go to the top right corner, click on File, Build Settings... and click the Add Open Scenes button, this button will add the Final Scene to the project list!

Let’s modify the scripts to create the Final condition, go to  the Project tab and open the Player script, then in the void Update() after the first ({) add:

if(FindObjectOfType<GameManager>().score >= 4)
{
  SceneManager.LoadScene("Final");
}

It should look like this:

The Final Scene Script

Ready! Now just test the game, you will see that as soon as you interact with the last girl an End screen will appear!

Here’s an example:

Making the final game scene in Unity GIF
Making the final game scene in Unity GIF

And that’s it! Save your project and now you’ll have a short and working game! Remember, everything you’ve learned in this tutorial can be applied to the development of countless games!

Exporting the project!

(Creating the game executable)

Once you have a playable version of your game, to turn it into an executable and publish it, you’re going to need to do a process that we call Compilation, it’s pretty simple, let’s go?

Go to the top left corner under File, then Build Settings... You’ll see this screen that we’ve seen before when we save the scenes:

Exporting the project in Unity

On this screen you will see in the left corner in the "Platform" part that Unity can export to various types of devices, and there it is set as default the Windows, Mac and Linux device, leave this option in case you want to export your game and publish it in an executable way through Download

But in this article I’m not just going to teach you how to develop a game, I’m going to teach you how to publish it on the biggest adult gaming site today, Gamcore! So let’s use the WebGL option, select this option and at the bottom click on Switch Platform and wait!

Selecting a platform

After a while (depending on the processing power of your computer) the Build  button and the Build And Run button will appear, Click on the Build button, it will ask you to choose a folder to create our HTML5 file, which is exactly the game in the format for Web, create a folder with the name of Builds, and save inside! At this point it is normal to take a long time, depending on the amount of Assets and files your game has, and also the computational power you have, just wait!

Build the package

Now go to the folder you just created, the Builds folder, it should look like this:

The files of the project as exported from Unity

Ready! Now you have your game ready for publishing!

Publishing the project!

(Showing your game to the public!)

Let’s now learn how to publish our game on today’s biggest adult gaming site, Gamcore, so let’s go!

To do this, go to  the Builds folder where the game is, Select All, right-click and click Add to archive... (We need to compress the game to add to the site):

Creating zip file from the folder of exported project

On the screen that appears, put the name of your game in the file name field, and then select the ZIP option and then Ok:

Zip file selection

In the end, your game should look something like this:

Game Project Zip file
Game Project Zip file

Now go to the Gamcore website: https://gamcore.com/ and at the top of the page you will find the Upload option:

Gamcore Website Upload Button
Gamcore Website Upload Button

Or go straight to the link: https://sandbox.gamecore.com/upload 

Don’t forget to create an account to upload your game, there is a green button that says Register, it’s in the top right corner!

Gamcore website register
Gamcore website register

Create your account and then log in to the website, you can also log in with your Facebook!

Again the link to upload the game is: https://sandbox.gamecore.com/upload

You’ll see a screen that looks like this:

Uploading your project to Gamcore

Fill in the Game Name field  with the name of your game, and in File, you need to access the file we just created, remember to check if it is in ZIP format!

In the Screenshots field, it is very important that you take pictures of your game during gameplay, at the best times, this will attract more players to play your game! To do this you can use the shortcut Windows + Shift + S to create custom Screenshots, or the Print Screen button  on the keyboard and paste (Ctrl + V) into a photo editing program, such as Paint itself, save the files (Maximum of 10) and add them to the fields!

In the Description field, it is important that you make a description of your game in a unique way, talk a little about the story, the gameplay style and everything else you want to describe!

In the Tags field, they are basically the search tags that people will use to find your game, and also to describe the content that exists in your game, put the tags you want for example: Platform, Blowjob, Anal sex, Pervert nights (Don’t forget to use the comma to separate the tags)

Example:

Adding tags to the project

In  the Width and Height field, set the width and height of your game, by default it is set to 1280 and 720, but you can set it according to what you want

In the CAPTCHA field you will basically prove that you are human and not a bot, well… I think this field is self-explanatory!

And finally, click on the SEND button!!

The send button

The Gamcore team will receive your game and test it, if your game is approved they will publish it on the site! Good luck!

Final thanks!

(Purpose of the Handbook and more!)

Thank you to everyone who followed this Manual to the end! I hope I’ve helped everyone develop their first games and publish them! 

It wasn’t an easy task to develop a simple and quick manual of an adult game, but it was a rewarding experience! I hope to see your games on the site soon!

This game (Pervert Nights) is a Real game that I will continue and constantly update until it becomes a great game! You’ll be able to check out the game through my Patreon and see the current progress of the game (depending on the date you read this manual).

Just remembering that the download of the files used in this tutorial and the project itself will be at the end of this Manual with everything else needed!

See you next time!!

LINKS:

]]>
https://gamcore.alloxesinfotech.com/game/manuals/how-to-create-an-adult-game-part-2/feed/ 0
How to Make an Adult Game https://gamcore.alloxesinfotech.com/game/manuals/how-to-make-an-adult-game/ https://gamcore.alloxesinfotech.com/game/manuals/how-to-make-an-adult-game/#comments Thu, 10 Oct 2024 06:14:41 +0000 https://gamcore.cm/?p=124 Hi everyone ?

I’m a long time adult game developer, (I love my job) In this tutorial we will learn how to make an adult game from 0, I accepted a challenge to create a Tutorial so that anyone without the need for programming knowledge can develop it, and take what has been learned as a basis to develop future games, We will learn from the Download of the chosen Engine, until the publication of the game, You can find out more about me through my Patreon

At first we will use the Unity engine, as it is free and easy to access for beginners, This engine will allow you to publish games for platforms from PC to mobile devices and consoles! note that for the development of a complex game it takes a lot of time and dedication, As I intend to make a quick and practical tutorial, we will use simpler systems and a more summarized game, but with an ability to be expanded!

Get started!

(Engine Download & Install)

Step 1 – Let’s download the engine, you can find the latest version of the engine at the link: https://unity.com/download and click on the Download option:

Download Unity

Next, you will be able to choose your operating system:

Download the Unity Hub

Step 2 – To do the installation is no secret! just click on I Agree, Install,and finish, Once the installation of the Unity HUB is complete, if you start the installation of the Editor, which is where we will be working, the following window will appear when the installation is complete, just click on Install Unity Editor:

Install Unity Editor

Step 3 – We will also need a code editor, I will use Visual Studio as an example in the images, but you can use any of your preference (even a notepad), Just check the Microsoft Visual Studios Community option as soon as you install your Unity Editor:

Download Visual Studio

Finally, once you’ve installed Unity and its code editor, don’t forget to create an account in the top left corner of the Unity Hub! (You can use a google account for login)

Creating our first project!

(Creating a 2D Project)

Step 1 – Finally we will create our first project, Let’s start with a game in 2 dimensions, For this initial tutorial, I opted for the 2D option because it is faster and more practical to develop the assets and systems, but note that you can use the same steps to develop your 3D game as well!

On the Projects tab, click the blue button (New Project)

Create new project in Unity Hub

Then in the next window, choose the 2D option, and Rename the project according to your liking, For this tutorial, I’ll call the game Pervert Nights, and click Create project!

Creating a 2D project in Unity 3D

Step 2 – As soon as you click to create a new project, this process may take a while (depending on your computer) but in the end you will see this interface:

Create new project screen

The first thing we need to do when opening our project, is to organize the Assets, so we will create 4 folders, Objects, Characters, Scripts and Animations, At first they will be the folders that we will use for our project, but you can create more folders according to your project to add for example Sounds or Particles

To create folders you need to right-click on the Assets area, and then go to Create and then Folder:

How to Create Folders in Unity GIF
How to Create Folders in Unity GIF

Step 3 – Let’s now learn how to add objects and backgrounds to our game, At the end of this file, I will make available to everyone the download of the assets that we will use in this tutorial, but remember, you can use your own drawings or assets as you prefer!

There are several ways to add the assets to our project, one of them is by clicking and dragging the assets to the desired folder, The second way is by copying the assets and pasting them into the desired folder, do it like a common file on your computer!

How to import assets in Unity GIF
How to import assets in Unity GIF

And that’s it! We already have assets available to get you started!,

Developing our first scenario!

(Setting up a background with only Objects and images)

To set up our first scenario, we could use a Unity technique to create Tiles, but since the goal of this tutorial is to do it in an easier and faster way, we will use objects!

Step 1 – In our Unity project, inside the Objects folder where we put our first Assets, Click and drag the image (Background) to the stage as I will do in the GIF below, and then duplicate the image using the shortcut Ctrl + D and drag to the side, creating a starting background for our game!

How to make a background in Unity GIF
How to make a background in Unity GIF

You can use the Move Tool to adjust the position you want of an object, better aligning the 2 objects that make up the Background!, To use it just click on the object you want to move and use the green arrow for up and down, and red for left and right!:

Ready! Once you’ve added the 2 Objects that make up our first Background, and aligned them correctly, we can now add a floor for the character!

Step 2 – Let’s now add a floor to our game, we will use the same process for this, First we will make the base, drag to the scenario the image called (Base) then put it in position and use the Rect Tool to increase the size, see the example below:

How to make a base in Unity GIF
How to make a base in Unity GIF

Now let’s place our floor, do the same process for the image (Ground1) Duplicate it using the (ctrl + D) and adjust its position always next to it until it fills all the space, at the end you can click on the Game tab to see the result! Here’s an example:

How to make a ground in Unity GIF
How to make a ground in Unity GIF

Ready! We now have a floor for our scenario, That way we will have more objects in the game, which will make the performance of the game not the best possible, But as it is a 2D game where we will have few elements, this will not be so relevant!

Note that in the Hierarchy menu we can see all the objects we create in the game, It will be important in the future to organize everything!

Creating colliders!

(Adding Collision to an Object)

Colliders are very necessary for our project, as they are the ones that will prevent the player from crossing to unwanted places, such as the floor or walls!

At first we are going to add a collider at the base of our floor, to do this is very simple, just select our base, and then go to the inspectortab and click on the Add Component button, then we will search for collider and select the option Box Collider 2D ready!

Here’s an example:

How to create a collider in Unity GIF
How to create a collider in Unity GIF

There are several other types of colliders and several different shapes, it is a very important tool that we will need to use throughout this tutorial, they are also used to create detection areas, where for example the game will detect when our character is close to a door

Creating our character!

(Adding the character to the game with scripts)

Step 1- Well, now that we’re more or less familiar with Unity’s interface, we’ve learned how to import files and put them on stage, let’s now go to a more advanced step!

Remember the folders I asked you to create? Don’t forget to import the Assets that I’m going to leave in this tutorial to the specific folders, go to the Characters folder, we’ll find our character there, Then we’re going to organize the zoom of the folder to see a list with the names that we’re going to need, And we’re going to drag our character to the stage, drag the Player Idle file to the stage.

Do as example:

How to add the character to the stage in Unity GIF
How to add the character to the stage in Unity GIF

Step 2- Note that the character is behind the stage, this happens because we haven’t defined a layer order for him, so it’s time to start organizing our project!

First set the character layer order to 2, to do this click on the character asset in the Hierarchytab and then in the Inspector tab, in the Orden in Layer option set 2 this will make the character in visibility priority in the game

Here’s an example:

How to change the layer order in Unity GIF
How to change the layer order in Unity GIF

To better organize our project (it’s very important to learn this so that your project isn’t so hard to find assets and be modified) Let’s organize with empty files!

Empty files work as folders for example, let’s start by creating an empty file called Groundand then we’ll drag all the content that is part of the floor into it, do the same with the background!

Finally, let’s rename the Player Idle asset in the Hierarchy menu to Player only!

Here’s an example:

How to organize the project in Unity GIF
How to organize the project in Unity GIF

You can arrange it however you like, but look at the example how we eliminated visual clutter from the Hierarchy menu!

Step 3- Let’s now work on our character itself, notice that he is too big and in my case he is misaligned with the ground, let’s use the tools we already know before to move him and reduce his size until he is more or less like this (Yes floating… you’ll know later):

Working on the character

Great! Now we need our character to have 2 bridges as well! The first one is a collisor, we need it not to go through everything like a ghost, so we’re going to use the Capsule Collider 2D, we’re going to add it in the same way as we did with the floor, you can edit the collision freely using the Edit Collider tool if you prefer.

The second component that we will need is the RigidBody, with which we will have a physics in the character! It is an indispensable component if we want our character to have gravity, to which we add the Rigidbody 2D component

Remember how we put our character “floating” on the stage? We need this to test our gravity, then hit the play button and watch the magic happen!

Here’s an example:

How to create phisics in Unity GIF
How to create phisics in Unity GIF

We also need to lock the rotation of the character so that he doesn’t “stagger” around, exit the play mode and in the Rigidbody 2D menu you just created, go to Constraintsand check the option Freeze Rotation Z is not mandatory for all projects, but this will avoid several bugs in this one!

Step 4 – Now in step 4 we will start working with Scripts!!

Scripts are programming commands that we will use to perform some actions in the game, but don’t worry! You won’t need to be a master of programming to create the game of this tutorial, we will add simple commands and all of them will be available both in the Download and throughout the tutorial, just follow!

To create a script, we will first go to the Scripts folder and create a script by right-clicking on the empty part of the folder, going to Createand C# Scriptand putting the name of Player.

Now let’s add the Script to the Character, Click on the script you just created and drag it to the Asset Player in the Hierarchy menu, now we can open our script by double clicking on it and finally start programming!

Do as example:

How to create scripts in Unity GIF
How to create scripts in Unity GIF

At the beginning of the tutorial we installed Visual Studio as an editor for scripts, but you can use whichever editor you prefer, or even a notepad to open a script!

Step 5 – From that point on, we’ll just create the lines of character code, so just look at the screenshots of the script and try to edit your script so that it looks exactly as it is in the example! Be very careful with semicolons, any divergence will create mistakes!

Let’s start by defining the speed of our character, in the script, under the first “{” add the following line of code:

public float Speed = 5;

Note that 5 is the player’s speed, you can add a higher number if you want a faster movement, or a lower one if you want a slower one!
It looks like this:

Define the Speed of the animations

Next we will add a new function to control the movement of the player with the directional arrows or the A and D, Before the last “}” add:

void Move()
{
   Vector3 movement = new        
   Vector3(Input.GetAxis("Horizontal"), 0f, 0f);
   transform.position += movement * Time.deltaTime * Speed;
}

It looks like this:

Controlling the moment of the character

Now let’s call the method we just created in the “void Update()” Just add between the two “{ }”:

Move();

It looks like this:

The Move function

Now let’s save our script (Ctrl + S) and let’s play our game to test! Try to use the arrow keys to move the player around

Here’s an example now:

How to do character movment in Unity GIF
How to do character movment in Unity GIF

Step 6 – Now that we have the movement of the character, let’s create the jump!

To do this, just as we created our move function (void Move) let’s also create the jump function (void Jump) in the last “}” of the script once again, add the following script line:

void Jump()
{
   if(Input.GetButtonDown("Jump"))
   {
       rig. AddForce(new Vector2(0f, JumpForce), ForceMode2D.Impulse);
   }
}

Next, let’s add 2 more variables at the beginning of the script after the Speed variable we added earlier:

public float JumpForce = 8;
private Rigidbody2D rig;

The number 8 of this JumpForce variable can be changed to the jump size you prefer as well!

Now let’s link the rig variable to the Character’s RigidBody, for this in the void Start() after the first “{” add:

rig = GetComponent();

And finally, let’s call our new Jump function in the void Update() just below our Move() line; add:

Jump();

Ready! The script for the jump is finished!

(Make sure the Script is exactly like the one I’ll show you in the following image)

Here’s what the final script looks like:

The final script

(Make sure the punctuation is correct and that the script doesn’t have any error signs)

Then save the Script (Ctrl + S) and test the game using the spacebar to jump!

Here’s an example:

How to make a jump in Unity GIF
How to make a jump in Unity GIF

Finally, in  the RigidBody 2D of the Player in the Inspector tab, change the Gravity Scale to 2 (This will increase the gravity making the jump more realistic)

Gravity Scale

Now we need to limit the player to only 1 jump per turn, so let’s work with collision identification!

In  the Hierarchy  tab Select the Ground, then go to the Inspector tab and click on the Default Layer and go to Add Layer... then add the name Ground in User Layer 6.

Redo the same steps, Go to  the Hierarchy tab Select the Ground, then go to  the Inspector tab and click on the Layer Default and now select Ground, and confirm Yes, Change Children for the msg that will appear!

Here’s an example:

How to define a layer in Unity GIF
How to define a layer in Unity GIF

Now let’s go to the script, let’s add 2 functions for this condition, before the last “}” of the script add:

private void OnCollisionEnter2D(Collision2D collision)
    {
       if(collision.gameObject.layer == LayerMask.NameToLayer("Ground"))
        {
            isJumping = false;
        }
    }
    private void OnCollisionExit2D(Collision2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Ground"))
        {
            isJumping = true;
        }
    }

Example:

On Collision Function

Now add the variable that will check if the player is jumping, Under the rig variable, add:

public bool isJumping;

Example:

Adding isJumping variable
Adding isJumping variable

And finally, in our void Jump()  function replace the line:

if (Input.GetButtonDown("Jump"))

By:

if (Input.GetButtonDown("Jump") && !isJumping)

That will check if the player is jumping or not, then save the script and test the game!

The Script should look exactly like this:

The Player class

Creating animations!

(Animating the character)

Step 1- Finally we have reached an indispensable part of the project, let’s now learn how to work with animations and how to control them.

To start, we will need 2 new tabs in our Unity, the Animationand Animatortab, to add them to your interface you must go to  the Windows menu at the top of the screen, then to Animation, and once again to Animation, do the same process to activate Animator as well, don’t forget to organize the windows as you wish!

Here’s an example:

How to show an animation interface in Unity GIF
How to show an animation interface in Unity GIF

These are the interfaces we’re going to use to create and control our animations!

Let’s now create our first animation which will be the animation of the stationary character, for that we click on the player's asset in the Hierarchy menu, then we click on  the Createbutton that is in our new Animation window, Unity will ask you to define the place where the animation will be created, let’s create them in our Animations folder that we created at the beginning of the tutorial,  Set the name of our new animation to Player_Idle. 

Now we need to do something really important, we’re going to put our new Animation window, in a place away from our Project window, you’ll see why

Here’s the step-by-step guide:

How to create a new animation in Unity GIF
How to create a new animation in Unity GIF

We need to do this because we’re going to need to drag content from the Project tab to the Animation tab!

Now we have created our first animation file, we just need to add the content, go to the Animations folder in the Project tab, and search for the frames of the animation (Player Idle anim) there will be 10 images that make up the animation, after that click and drag them into the Animation window (you can hold the Shift button to select all at once).

Next, we’re going to increase the length of the duration of our animation by clicking and dragging in the corner of the frames until we reach 1:00, and then we’re going to play our game and see how it turns out!

See the example below:

Idle Animation in Unity GIF
Idle Animation in Unity GIF

Ready! We have an Idle animation of our character, you can change the animation speed and frames as much as you want in the Animationwindow, this goes for any animation you are going to use in unity using frames!

Now we’re going to create the character’s walking animation, we’re going to use the same steps for this, but we need to create a new animation inside the player, For that we’re going to go to our Animation tab, then click on the top left corner in Player_Idleand go to Create New Clip… let’s call this new animation Player_Walkand save it to the Animations folderas well!

Now we’re going to do the same process, drag the animation from the Project tab into the animation in the Animation tab, then we’re going to change the size of the animation as well until we hit 1:00.

See the example below:

Create a walk animation in Unity GIF
Create a walk animation in Unity GIF

Now to finish this step and as a learning exercise, do the same procedure to create the Player_Jump!

Step 2- Now let’s learn how to control our animations! If you played the game, you noticed that only one animation is running, which was precisely the first one we created, this happens because Unity defines the first one created as the default, and we now need to create conditions for the other animations to be executed, let’s go? Go to the Animatortab that we recently opened, notice that our 3 animations are there!

Player Animations

Now we need to create the transitions of the animations, and their conditions, for this in  the same Animator tab, go to the top left of the Animator tab, and click on Parameters, then click on the “+” sign and create a variable of type Bool, put the name of walk, do the same process and create another variable of type Bool Called Jump, we’ll use that later!

Now let’s create the transitions, Right click on the Player_Idle animation  that is highlighted in orange, and click on the Make Transition option, then click on the animation Player_Walk, that way notice that we have created a transition between the two animations, now click on the animation Player_Walk and return to the transition to the Player_Idle,  Do the same with the Player_Jump too!!

Here’s how to do it:

How to Create animation Transition in Unity GIF
How to Create animation Transition in Unity GIF

We need a few more steps to finish the conditions and transitions, now that you’ve arranged the animations in a way that we can see the transitions let’s get to work!

Na transição que vai do Player_Idle para Player_Walk, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina walk e true.

Na transição que vai do Player_Walk para Player_Idle, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina walk e false.

Na transição que vai do Player_Idle para Player_Jump, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina jump e true.

Na transição que vai do Player_Jump para Player_Idle, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina jump e false.

Na transição que vai do Player_Walk para Player_Jump, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina jump e true.

Na transição que vai do Player_Jump para Player_Walk, clique na seta e vá em Conditions na aba Inspector, e clique no sinal de “+” defina jump e false.

Uffa! Now we have all the conditions set! A little tweak now!

Our game won’t need a delay in the animations, so in all the transition arrows that we’ve tweaked now, we’re going to modify some small settings.

Do this for all transitions: go to  the Transition Inspector  tab, and uncheck the Has Exit Time option, then go to Settingsuncheck the Fixed Duration option  and set Transition Duration to 0, Done!

Here’s how to do it all:

How to setup transitions in Unity GIF
How to setup transitions in Unity GIF

Now let’s go to the scripts to make all this happen, open up the Script Player that we created earlier and let’s add the following variable just below the isJumping variable that we created:

private animator anim;
Player Monobehavior class

Now inside the Void Start() before the last “}” add:

anim = GetComponent<Animator>();
The Start function

Now inside the Void Move() before the last “}” add:

if (Input.GetAxis("Horizontal") > 0f)
        {
            anim. SetBool("walk", true);
            transform.eulerAngles = new Vector3(0f, 0f, 0f);
        }
        if (Input.GetAxis("Horizontal") < 0f)
        {
            anim. SetBool("walk", true);
            transform.eulerAngles = new Vector3(0f, 180f, 0f);
        }
        if (Input.GetAxis("Horizontal") == 0f)
        {
            anim. SetBool("walk", false);
        }
The Move function

Now in the Void Jump() below the line:

rig. AddForce(new Vector2(0f, JumpForce), ForceMode2D.Impulse);

Add:

anim. SetBool("jump", true);
The Jump function

Pro Fim, Na Private Void Oncollisionneer2D, Abixo De:

isJumping = false;

Add:

anim. SetBool("jump", false);
Jumping the characters on collision

Ready! Now save the script and test your game!

The result should look something like this:

Testing Animations in Unity GIF
Testing Animations in Unity GIF

Interaction with NPCs!

(Like interacting with NPCs or objects!)

Step 1- Now that we have all our player animations ready, let’s start the +18 part of the project! To do this we will make our first objective, we will create an interaction of the player with a girl by pressing the key (E) and we will have a sex scene with her!

To do this the first thing we need to do is add the girl to our scenario, for this go to the Project tab, and in  the Characters folder choose the image with the name (1) is our first girl, drag her to the scenario, when you do this you will notice that she is not appearing (she is behind the other objects) let’s again change the order in which she is seen,  in the Inspector tab, go to Orden in Layer and place (2), Don’t forget to change the size of it and align it with the ground!

Let’s also add the bed as an object! To do this, go again to  the Project tab, and in  the Objects folder, drag the file (Bed) to the stage and do the same process as you did with the girl, put the Orden in Layer on (1) so that it is behind her.

Here’s how it’s done:

How to add a girl character in Unity GIF
How to add a girl character in Unity GIF

Ready! We have our first girl in the game, but we need to now create the player interaction with her, let’s add a collider to her so that we can define when we’re going to touch her and start our interaction.

In the Hierarchy tab, click on the girl (1) and go to the Inspector tab and Add Component, look for and add a 2D Box Collider, Once this is done we have a collision on our girl, in  the 2D Box Collider that you just added, check the Is Trigger option, this will make sure that our player is not blocked by the girl!

It will look like this:

2D Box Collider

Step 2- Now let’s make it so that when touching the girl, a warning key (E key) appears and we can also start our interaction (Sex scene).

Go to the Project tab, and in our Scripts folder create a new Script called FirstGirl, click and drag the newly created Script to our girl in the Hierarchy tab to add it to her! Let’s now work on the Script that will command everything that will happen in the interaction! Open the FirstGirl Script, you’ll see this:

The Start and Update functions

Underneath the first ({) Add:

public GameObject iconE;

This will be our variable that will hold the object that will represent our AND key, it will look like this:

The iconE Game Object

Now on top of the last (}) of the Script add:

void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Player"))
        {
            iconE.SetActive(true);       
        }
    }
 
    void OnTriggerExit2D(Collider2D collision)
    {
        if (collision.gameObject.layer == LayerMask.NameToLayer("Player"))
        {
            iconE.SetActive(false);
 
        }    
    }

These are the two functions that we will use, the first for when there is a collision between the two objects, and the second for when the collision is broken

It will look like this:

The trigger enter and exit functions

Save the Script and let’s go back to Unity!

First let’s set our main Character as Player, let’s add a tag to him so that he is recognized in the game, go to  the Hierarchy tab and click on our Player, then go to  the Inspector tab and in Layer click on Default, then on Add Layer...Choose an empty field and put the name of Player, then go back to the Hierarchytab and click on the Player again, and in the Inspector  tab select the Layer Player!

Here’s an example:

How to create a player tag in Unity GIF
How to create a player tag in Unity GIF

Now let’s add the representation of the E button  on our girl, in  the Projecttab, go to the Objects folder and click and drag the object (E) to the stage, position the object on top of the girl’s head (don’t forget to change the Orden in Layer of it to (3), it will look like this:

The E icon

We don’t need this E button popping up all the time, so let’s disable it for now, go to the Hierarchy tab  and click on  the E button, then on  the Inspector tab, just uncheck the option next to your name, it will be invisible in the scenario! Here’s what it should look like:

The E Icon in Inspector

Now let’s go back to the Hierarchy tab and click on the girl (1) See that in  the Inspector tab, where our script is (FirstGirl) the E Icon is like: None (Game Object) we need to add the game object (E) in this region, just go to the Hierarchy tab, click and drag the (E) for that region, After testing the game, an indicator (E) should now appear every time you touch the girl!

Here’s an example:

Adding an indicator for interaction in Unity GIF
Adding an indicator for interaction in Unity GIF

Step 3- Let’s now create the sexual animation between our player and our girl, for this go to  the Project tab, then go to Animations and search for the  Girl 1 Handjob animation, this animation will have 21 Frames, select all and drag it to the scenario, automatically Unity will ask you to save the animation, save it in  the Animations folder with the name FirstGirl_Handjob, now as we learned earlier, position the animation in the place where the girl is and change the Order in Layer to 2 this will make her visible!

Then we’re going to make our sex animation invisible, so that it only appears when the player interacts with the girl, Click on our new animation and go to  the Inspector tab, and disable the option next to the name as we did earlier!

Here’s an example:

Adding a sexual animation in Unity
Adding a sexual animation in Unity

Once this is done, we just need to create the conditions in the Script so that some things are active and others are disabled, let’s go! Open the FirstGirl Script, after the iconE variable, add:

private bool isCollision;
public GameObject player;
public GameObject girl;
public GameObject bed;
public GameObject handjobAnim;
The First Girl Monobehavior class

After the first ({) of the void Update(), add:

if (Input.GetKeyDown("e") && isCollision)
        {
            player.SetActive(false);
            girl.SetActive(false);
            bed.SetActive(false);
            handjobAnim.SetActive(true);
        }
The Update function

In the void OnTriggerEnter2D, before iconE.SetActive(true); Add:

isCollision = true;

In the void OnTriggerExit2D, before iconE.SetActive(false); Add:

isCollision = false;

Salve o Script

Now go to the Hierarchy tab, and click on our girl (1) in the Inspector tab, notice that the First Girl script is missing add the objects to  the variables Player, Girl, Bed and Handjob Anim Add the Objects according to what you ask, 

Here’s an example:

Setting objects into variables in Unity GIF
Setting objects into variables in Unity GIF

you can already test the game, now when you press the E key  while you are next to the girl the sex scene will begin!

But now we have an infinite sexual looping, let’s now create a condition for the animation to end and the player to move again, for this create a Script called FirstGirlEND, and open it.

Below the first ({) Add:

public GameObject player;public GameObject handjobAnim;

In void Start() after the first ({) Add:

StartCoroutine(endAnimation());

Now before the last (}) Add:

IEnumerator endAnimation()
    {
        yield return new WaitForSeconds(10f);
        player. SetActive(true);
        handjobAnim.SetActive(false);
    }

The Script will look like this:

The FirstGirlEnd monobehavior class

Almost there! Now save your Script and let’s go back to Unity, Click and drag the FirstGirlEND  script into the animation (Girl 1 Handjob0001) we created in  the Hierarchy menu.

Now we need to add the Objects to the animation (Girl 1 Handjob0001) as well, do the same process we did before and you’re done! Just try it now!

It should look like this:

Handjob Animation GIF
Handjob Animation GIF

Creating a scoring system!

(Working with UI and goals!)

To be continued..

LINKS:

]]>
https://gamcore.alloxesinfotech.com/game/manuals/how-to-make-an-adult-game/feed/ 1