Good Mocking Attack Design – Game Development Stack Exchange

I'm doing a turn-based RPG, and in an attack, a group member can target an enemy for a set number of turns. I think that an attack that attacks all enemy attacks is very strong, so I'm not sure how to balance it.

Should derided enemies receive bonus attack statistics to offset the temporary loss of their AI and the ability to attack weaker party members? Or is a party member at the center of attacks something that should be rewarded, and the party member should be temporarily healed or defended to compensate for the risk taken?

Object-oriented hangman game

I'm a hobbyist trying to become a professional software developer. I'm very interested in data science in general, and my goal is to master Python before I go into more detail on specific topics in the field of data science.

I developed this game when I started studying object-oriented programming. Thank you all in advance.

import os
import getpass

class Hangman:
    winner = False
    word = ''
    mask = ''
    mistakes = ()

    def __init__(self, word):
        self.word = word
        self.mask = '_ ' * len(word)

    def make_move(self, letter):
        letter_match = self.word.find(letter)
        if letter_match >= 0:
            for i, w in enumerate(self.word):
                if w == letter:
                    new_mask = list(self.mask)
                    new_mask(i * 2) = letter
                    self.mask = ''.join(new_mask)

            self.check_winner()
        else:
            self.mistakes.append(letter)
            print('Wrong!')


    def check_winner(self):
        if self.mask.find('_') < 0:
            self.show_board()
            print('You won!')
            self.winner = True

        return self.winner

    def check_looser(self):
        if len(self.mistakes) > 4:
            print('You loose! The word was %s' % self.word)
            quit()

    def show_board(self):
        os.system('cls')
        print(self.mask)
        print(self.mistakes)

    def play(self):
        while not self.winner:
            self.show_board()

            letter_input = input('Choose a letter: ').upper()
            self.make_move(letter_input)
            self.check_looser()


secret_input = getpass.getpass('Secret Word: ').upper()

game = Hangman(secret_input)
game.play()

Architecture – Is it a good idea to use high-level APIs to develop game engines?

I've looked around the internet and found articles that describe what you should learn to develop a game engine. What I hear in many articles over and over again is that you should learn low-level graphics APIs like OpenGL or D3D11 (great article for example: https://www.haroldserrano.com/blog/how-to-become- a-game-engine-developer), for example for the rendering of graphics.

NOTE: For my question, I use graphic rendering as an example, as this makes the most sense for me here.

That made me think. Is it really necessary to reinvent the wheel by creating your own framework to render only graphics? Is not it enough to learn a library like babylon.js for rendering graphics on the web? If the main goal in creating a game engine is to create a software framework for creating video games, it should not be a problem to spend time developing a complete framework for graphics when others are experiencing the problem of using their graphics libraries for video games You have solved.

Snake Game C ++ improvements? – Code Review Stack Exchange

Suggestions or improvements that you would suggest to improve this code? In particular, any code that makes the movement of the snake smoother and makes the cursor disappear.

#include 
#include 
#include 
#include 

unsigned long int score, high_score = 0;

const int no_rows = 22, no_columns = 77, head_position = 0;

char choice, token, token_food, key_press, direction_head, overlay;

char board(no_rows)(no_columns);

unsigned int i, j, k, snake_length, grow, crash;

struct position
{
    int row;
    int column;
} head_map(no_rows * no_columns), food, temp1, temp2;

void Initialize()
{
start:
    clrscr();

    cout << "ttttWELCOME TO SNAKE GAMEnnn";
    cout << "Choose the Body of the Snake(Enter a symbol):n";
    cin >> token;
    cout << "nChoose the Food of the Snake(Enter a symbol):n";
    cin >> token_food;

    if(token_food == token)
    {
        clrscr();
        cout << "nDon't use the same symbols for food and body of the snake!!!nnn";
        goto start;
    }

    cout << "nnUPt-tWnDOWNt-tSnRIGHTt-tDnLEFTt-tAnnnARE YOU
         READY(Y / N) ?? n";
         cin >> choice;

    for (i = 0; i < no_rows; i++)
    {
        for (j = 0; j < no_columns; j++)
            board(i)(j) = ' ';
    }

    head_map(0).row = no_rows / 2;
    head_map(0).column = no_columns / 2;

    board(head_map(0).row)(head_map(0).column) = token;

    direction_head = 'R';
    snake_length = 1;

    grow = crash = score = 0;
}

void Food()
{
    do
    {
        food.row = rand() % no_rows;
        food.column = rand() % no_columns;
    }
    while(board(food.row)(food.column) == token);

    board(food.row)(food.column) = token_food;
}

void Display()
{
    clrscr();

    for(k = 0; k < (no_columns + 2); k++)
        cout << "-";

    cout << endl;

    for(i = 0; i < no_rows; i++)
    {
        cout << "|";
        for(j = 0; j < no_columns; j++)
            cout << board(i)(j);
        cout << "|" << endl;
    }

    for(k = 0; k < (no_columns + 2); k++)
        cout << "-";

    cout << "ttttt  SCORE :" << score;
}

void Input()
{
    if(kbhit())
    {
        key_press = getch();

        if((key_press == 'd' || key_press == 'D') && (key_press != 'a' || key_press != 'A') && (direction_head != 'L'))
            direction_head = 'R';

        if((key_press == 's' || key_press == 'S') && (key_press != 'w' || key_press != 'W') && (direction_head != 'U'))
            direction_head = 'D';

        if((key_press == 'a' || key_press == 'A') && (key_press != 'd' || key_press != 'D') && (direction_head != 'R'))
            direction_head = 'L';

        if((key_press == 'w' || key_press == 'W') && (key_press != 's' || key_press != 'S') && (direction_head != 'D'))
            direction_head = 'U';

        if(key_press == 'p' || key_press == 'P')
            delay(5000);
    }

    temp1 = head_map(head_position);
    board(head_map(head_position).row)(head_map(head_position).column) = ' ';

    switch(direction_head)
    {
    case 'R':
    {
        if(head_map(head_position).column == no_columns)
            crash = 1;

        overlay = board(head_map(head_position).row)(++head_map(head_position).column);

        break;
    }

    case 'L':
    {
        if(head_map(head_position).column == 0)
            crash = 1;

        overlay = board(head_map(head_position).row)(--head_map(head_position).column);

        break;
    }

    case 'D':
    {
        if(head_map(head_position).row == no_rows)
            crash = 1;

        overlay = board(++head_map(head_position).row)(head_map(head_position).column);

        break;
    }

    case 'U':
    {
        if(head_map(head_position).row == 0)
            crash = 1;

        overlay = board(--head_map(head_position).row)(head_map(head_position).column);

        break;
    }

    default:
        break;
    }
}

void Move()
{
    board(head_map(head_position).row)(head_map(head_position).column) = token;

    for(i = 1; i < snake_length; i++)
    {
        temp2 = head_map(i);
        head_map(i) = temp1;

        board(head_map(i).row)(head_map(i).column) = token;
        board(temp2.row)(temp2.column) = ' ';

        temp1 = temp2;
    }

    if(grow == 1)
    {
        head_map(i) = temp1;
        board(head_map(i).row)(head_map(i).column) = token;

        ++snake_length;
        score += 10;
        Food();
        grow = 0;
    }
}

void Change()
{
    if(overlay == token)
        crash = 1;

    if(overlay == token_food)
        grow = 1;
}

void Game_over()
{
    getch();
    clrscr();

    cout << "nnnnnnnnnnttttGAME OVER!!!nttttFINAL SCORE: " << score;

    if(score > high_score)
    {
        high_score = score;
        cout << "ntttYOU BEAT THE HIGH SCORE!!!";
    }

    else
    {
        if(score == high_score)
            cout << "ntttYOU TIED THE HIGH SCORE!!!";

        else
            cout << "ntttHIGH SCORE: " << high_score;
    }
    getch();
    clrscr();

    cout << "nnnnnnnnnnntttDO YOU WANT TO CONTINUE(Y/N)??nttttt";
    cin >> choice;

    getch();
}

int main()
{
    do
    {
        Initialize();
        Food();
        Display();

        do
        {
            Input();
            Change();

            if(crash == 1)
                break;

            Move();
            delay(200);

            Display();

        }
        while(crash != 1);

        Game_over();

    }
    while(choice == 'Y' || choice == 'y');

    return 0;
}

Computer guess HI-LOW game C ++

I am currently a csc101 student and have not had any major problems with any of the projects so far, but in our two tests I've done a 63 and a 65 so far. Now I really want to be successful in this field I really can not afford not to pass the course this semester, so I've upheld my current grade with our projects. This latest task is a numbers game by HI LOW that the computer appreciates, and I have to give it the parameters, whether it's too high or too low. This is just my first iteration where I shut down a working layout. At the moment I have a problem where sometimes I am asked twice to answer yes or no and too high or too low. If someone has an input to this code, I would appreciate it very much. This is in C ++ in VS 2019.

#include 
#include 
#include

using namespace std;
int algorithm(int guess);

int main() {
    int num;
    int guess = -1;
    cout << "please enter a number between 1 and 19" << ": ";
    cin >> num;
    while (num != guess) 
    {
        algorithm(guess);
    }
     return 0;
}

int algorithm(int guess)
{ 
    string highlow;
    string yesno;
    string input;
    int counter = 0;
    if (counter == 0)
    {
        srand(time(NULL));
        guess = rand() % +19;
    }
    cout << "is this your guess? Answer yes or no:" << guess << endl; 
    cin >> yesno;
    if (yesno != "yes" || "no") {
        cout << "Please answer only yes or no" << endl;
        cin >> yesno;
    }

    if (yesno == "no") 
    {
        cout << "Too high or too low? Answer too high or too low" << endl;
        cin >> highlow;
        if (highlow == "too high")
            guess = guess - 5;
        if (highlow == "too low")
            guess = guess + 5;
        if (highlow != "too high" || "too low")
        {
            cout << "Please anwer only too high or too low" << endl;
            cin >> highlow;
        }
    }

    if (yesno == "yes")
        cout << "I know all" << endl;



    return 0;
}

Here's what it spends

Unity – How do you implement an arm-change system in a 2D game like DeadCells?

I want to know how to implement a weapon-switching system in a 2D game like DeadCells.

In this game, the main character can switch weapons that have animations with depth despite the 2D animation.

I found out how the developer created these animations with depth expression. https://www.gamasutra.com/view/news/313026/Art_Design_Deep_Dive_Using_a_3D_pipeline_for_2D_animation_in_Dead_Cells.php

But I still can not understand how to change them. Does anyone know the solution? Or did they just sprite for each weapon?

Python 3.6 Hangman game with .format graphics

This is my Python 3.6+ version of hangman Game, generated with graphics print and .format, I have never written any professional code, so I would like to know what needs to be changed to reflect best practices, efficiency and clarity of comments.

from random import randint
import os
WORDS = ("word", "object","radiant","wave","stream","jazz","wisdom","flow", "california", "metal", "book", "hero", "democracy", "beet", "tissue", "shall", "imminent", "delightful", "magnificent", "awful", "switzerland", "unbelievable","none","plus","one", "crocodile", "architecture", "monotheism", "philosophy", "practical")
LIMIT = 8
answers = (f"Find the word in less than {LIMIT} guesses. Good luck!n", "Correct!n", "Wrong guess.n", "Wrong input. Type a single letter or 'exit'n", "You already tried that letter.n")
word = WORDS(randint(0, len(WORDS) - 1)).upper()
wrong_guesses = ()
eval_guess = 0 #index for the 'answers' list
outcome = ""
last_tried = "" #last letter tried
# build hidden word:
hidden_word = ("_" for i in range(len(word)))
# Prints the hangman progress, default value is zero
def display_hangman(counter=0):
    if counter == 1:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |    n','   |  n','   |   n','  |n','|n'))
    elif counter == 2:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  n','   |   n','  |n','|n'))
    elif counter == 3:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \n','   |   n','  |n','|n'))
    elif counter == 4:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \|n','   |   n','  |n','|n'))
    elif counter == 5:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \|/n','   |   n','  |n','|n'))
    elif counter == 6:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \|/n','   |   |n','   |n','|n'))
    elif counter == 7:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \|/n','   |   |n','   |  / n','|n'))
    elif counter == 8:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   |n','   |   On','   |  \|/n','   |   |n','   |  / \n','|n'))
    else:
        print("{:^34}{}{:^31}{}{:^31}{}{:^30}".format(' _____n ','|   n','   |    n','   |  n','   |   n','  |n','|n'))
# clear the screen 
def clear_screen():
    os.system('cls' if os.name=='nt' else 'clear')
# display the messages of the game
def display_messages(wrong_guesses, hidden_word, eval_guess=0, LIMIT=8, outcome="", last_tried=""):
    clear_screen()
    print(f"n{' HANGMAN ':*^36}")
    display_hangman(len(wrong_guesses))
    if outcome == 1:
        print(f"{'YOU WIN!':^36}nYou rightly guessed: {word}")
        print("nYou also tried: ", wrong_guesses)
    elif outcome == 0:
        print(f"{'GAME OVER.':^36}n{'The word was:':^15}{word}")
        print("nYou guessed:", hidden_word, "nYou tried:", wrong_guesses)
    else:
        print(hidden_word,"n")
        print(f"{answers(eval_guess)}")
        print(f"Wrong guesses: {wrong_guesses} Wrong guesses remaining: {LIMIT - len(wrong_guesses)}")
        print(f"Length: {len(hidden_word)} last letter tried: {last_tried}")

# core of the game
while True:
    if len(wrong_guesses) == LIMIT:
        display_messages(wrong_guesses,hidden_word,outcome=0)
        break
    if "_" not in hidden_word:
        display_messages(wrong_guesses,hidden_word,outcome=1)
        break
    # messages function
    display_messages(wrong_guesses,hidden_word, eval_guess, LIMIT, outcome, last_tried)
    # user interaction
    prompt = input("Pick a letter or type 'exit' to quit: ").upper() #make input uppercase regardless
    if prompt.lower() == "exit":
        print("Bye.")
        break
    if prompt.isalpha() and len(prompt) == 1: # check if input single letter
        if prompt in wrong_guesses or prompt in hidden_word: # If letter already tried
            eval_guess = 4 
        elif prompt in word: # correct guess
            last_tried = prompt # update last tried letter
            eval_guess = 1 # set the answer to 'Correct!'
            for i in range(len(word)):
                if prompt == word(i):
                    hidden_word(i) = prompt # replace "_" with the letter
        elif prompt not in wrong_guesses: # Wrong guess. Add wrong letter to the wrong guesses list
            eval_guess = 2 # set the answer to 'Wrong guess!'
            wrong_guesses.append(prompt)
            last_tried = prompt
    else:
        eval_guess = 3 # wrong input'
``` 

Rating for the game site please.

advertising

Did not you do it?

With CPM banner ads, CPM email advertising, and contextual CPC links, you can promote virtually anything. You can target relevant parts of the site and serve ads based on the user's geographic location, if you so choose.

Starts at just $ 1 per CPM or $ 0.10 per CPC.

Memory and vector problem of a JOKENPO game – Python

I have to save the results of the winner in a vector and there is a draw.

I also have to repeat the code until the user decides when to log out (any number he does not type as 1,2,3). When he logs out, the user's profit and tie percentage must be specified.

from random import randint

itens = ('0', 'Pedra', 'Papel', 'Tesoura')
computador = randint(1, 3)

print('''
(1) Pedra (2) Papel (3) Tesoura''')

jogador = int(input('-> '))

if jogador != 1 and jogador != 2 and jogador !=3:
    print('Você não pode fazer isso!')
    quit()  

else:
    print('O computador jogou {}'.format(itens(computador)))
    print('O jogador jogou {}'.format(itens(jogador)))

if computador == 1:
    if jogador == 1:
        print('Empatou')
    elif jogador == 2:
        print('Você ganhou')
    elif jogador == 3:
        print('Você perdeu')

elif computador == 2:
    if jogador == 1:
        print('Você perdeu')
    elif jogador == 2:
        print('Empatou')
    elif jogador == 3:
        print('Você ganhou')

elif computador == 3:
    if jogador == 1:
        print('Você ganhou')
    elif jogador == 2:
        print('Você perdeu')
    elif jogador == 3:
        print('Empatou')