GithubHelp home page GithubHelp logo

Comments (25)

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024 1

can I do work in this. I am new to this type of thing so this one looks like I can do it...

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024 1

I would like to work on this project.

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024 1

ya thanks

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024 1

sorry for not being to active @ajaykumarr123 , lets work on this issue together :)

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024 1

I am currently working on a Start menu type of a thing where the user can change the colour of the coin.

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

@Xx-Ashutosh-xX Go ahead.

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

you will have to design a bunch of new colored svg coins.
you can straight away give the option to change color of the game board from blue to something else.
you can check if filling in a pattern instead of solid color can be achieved through pygame. (you will need to define those pattern)
at first you can assign a shortcut key to change the aesthetics randomly (I will suggest you this first, then you can integrate it with #9 )

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

I would like to work on this project.

please collaborate with @Xx-Ashutosh-xX

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

@Xx-Ashutosh-xX 👍

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

I am also working on the same to provide user with an option to change coin colours

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

Great @ajaykumarr123

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024

I am almost done with it ,but facing an issue and not able to exit menu loop to go into game loop

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024

`from assets import (
red_coin,
yellow_coin,
green_coin,
blue_coin,
violet_coin
)
from config import black,blue, red, white, yellow ,green ,violet ,blue_player
import pygame
from game_data import GameData

pygame.init()
data = GameData()
screen = pygame.display.set_mode(data.size)
screen.fill(black)

def button(msg,x,y,w,h,color,action=None):
"""
function to make buttons that perform an action
"""
mouse = pygame.mouse.get_pos()
click = pygame.mouse.get_pressed()
pygame.draw.rect(screen,color,(x,y,w,h))

if x+w>mouse[0]>x and y+h>mouse[1]>y and click[0]==1 and action != None:
    if action == start or action == quit :
        action()
    else :
        action(color)

FONT = pygame.font.Font("freesansbold.ttf",50)
textSurf = FONT.render(msg, True, black)
textRect = textSurf.get_rect()
textRect.center = ((x+(w/2)),(y+(h/2)))
screen.blit(textSurf,textRect)

def player_color(i,color):
"""
used to make a list which specifies the coin player 1 & 2 are using
"""
if i==0:
if color == red:
player_color_list[0]=red_coin
elif color == yellow:
player_color_list[0]=yellow_coin
elif color == green:
player_color_list[0]=green_coin
elif color == blue_player:
player_color_list[0]=blue_coin
elif color == violet:
player_color_list[0]=violet_coin
if i==1:
if color == red:
player_color_list[1]=red_coin
elif color == yellow:
player_color_list[1]=yellow_coin
elif color == green:
player_color_list[1]=green_coin
elif color == blue_player:
player_color_list[1]=blue_coin
elif color == violet:
player_color_list[1]=violet_coin

def color_select_1(color):
"""
used to select color for player 1
"""
button("Player 1",100,150,200,50,color)
player_color(0,color)

def color_select_2(color):
"""
used to select color for player 2
"""
button("Player 2",100,350,200,50,color)
player_color(1,color)

button("Player 1",100,150,200,50,red)
button("Player 2",100,350,200,50,yellow)
player_color_list=[red_coin,yellow_coin]

def start():
"""
used to start the game
"""
intro = False

def quit():
"""
used to quit the game
"""
exit()

def intro():
"""
Intro Screen loop
"""
intro = True
while intro is True :
pygame.event.get()
button("SELECT COLORS",100,50,450,50,white,None)

    button("",100,220,30,30,red,color_select_1)
    button("",150,220,30,30,yellow,color_select_1)
    button("",200,220,30,30,green,color_select_1)
    button("",250,220,30,30,blue,color_select_1)
    button("",300,220,30,30,violet,color_select_1)
    
    button("",100,420,30,30,red,color_select_2)
    button("",150,420,30,30,yellow,color_select_2)
    button("",200,420,30,30,green,color_select_2)
    button("",250,420,30,30,blue,color_select_2)
    button("",300,420,30,30,violet,color_select_2)

    button("START !",100,530,195,50,green,start)
    button("QUIT",400,530,195,50,red,quit)
    pygame.display.update()

intro()

import game`

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

are you creating new screen for colour change or providing options in starting screen?

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

Screenshot from 2019-12-18 01-26-09
Screenshot from 2019-12-18 02-37-03

@code-monk08 is it looking fine check once and any suggestion??

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

Screenshot from 2019-12-18 02-32-19

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024

I am thinking of something like a window where the users select their colours and then proceed
Screenshot (7)

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

are you creating new screen for colour change or providing options in starting screen?

you can provide options in starting screen itself, keep the current design consistent.

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

@code-monk08 I mean color change option on starting page and different color, save option in new screen as shown in previous screenshots.

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024

are you creating new screen for colour change or providing options in starting screen?

you can provide options in starting screen itself, keep the current design consistent.

Let's just keep one screen where a player could change their colour then start the game

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

I think that save option would be more proper for this and after press save button go back to starting page

from connect4.

bymayanksingh avatar bymayanksingh commented on June 10, 2024

Let's just keep one screen where a player could change their colour then start the game

I completely agree with this.

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

@code-monk08 I have completed first part and opened a PR #35 .

from connect4.

Xx-Ashutosh-xX avatar Xx-Ashutosh-xX commented on June 10, 2024

@code-monk08 I modified ajay's code and opened a PR #38
I have combined everything in one screen and also added the logo

from connect4.

ajaykumarr123 avatar ajaykumarr123 commented on June 10, 2024

@code-monk08 @Xx-Ashutosh-xX ya, I was thinking the same btw thanks for modification.

from connect4.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.