#game-development

1 messages ยท Page 93 of 1

serene moon
#

Set it to 0

#

idk how you would using this program. But I'm sure you know where to go

#

If it works like this documentation says it does, then I expect a part of your grade to be credited to me. A random on the internet.

#

If you have end game credits, I expect my name to be there.

#

๐Ÿ˜Ž

undone pilot
#

Haha, will do dude, thanks for the new info, very helpful

serene moon
#

idk what your school is like, but if it's anything like mine you can sell your new found information for their lunch money.

severe meadow
#

umm someone know how to use turtle?

#

umm is someone there? hlo?

severe meadow
sage merlin
green hornet
quartz geyser
#

Hello. I want to write a fish bot in Stardew Valley. To catch fish, you need to go through a mini-game. The fish must always be in a green triangle so that the scale is full and the fish are caught. How can I implement yu so that the fish always follows a green rectangle? Could you please tell me (

dawn quiver
#

has anyone made a ursina shader by raycasting if so pls message me i need help

brisk pilot
# quartz geyser Hello. I want to write a fish bot in Stardew Valley. To catch fish, you need to ...

Find a python library that let's you do inputs. Then code a series of movements to take the character from your farm to the desired fishing spot. Do some code to read a 1 pixel vertical line in the fishing meter, then use this pixel data to determine if you need to do more clicks or less in the desired spot. Finally code your character to after a set time return home. Added bonus for coding the bot to not break with events, to sell fish, and to update best fishing spot each season.

#

So now you know all the big steps, find that library and figure it out! Goodluck

small flint
#

How to make menus easily

round obsidian
#

<@&831776746206265384>

fervent rose
#

What the heck

#

!mute 634430242089467904

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied mute to @lusty condor until <t:1629917474:f> (59 minutes and 58 seconds).

round obsidian
#

@fervent rose they've changed their name from something else that was equally unserious

#

I don't think they're here to talk Python

green hornet
#

I have a question, what is a good game engine for beginners to learn to make 3d games?

round obsidian
green hornet
#

Thanks!

short silo
#

The first time i made a 3d game is using fancade, but its mobile app @green hornet

green hornet
#

Cool i might try that out!

cold storm
small flint
#

how do i add a proper grid in a rectangle screen 800x600

severe meadow
#

can someone help me with playsound

#

when sound plays my game stops

#

and how do i make the time short till the drum beets?

dense creek
#

Something like this:

import threading

audioThread = threading.Thread(target = lambda: yourFunction(yourArguments))
audioThread.run()
regal bridge
#

Can i ask questions about some libraries and their functionality at help channels? I want to ask about pygame.

severe meadow
severe meadow
#

but how?

severe meadow
dense creek
#

I never used winsound

#

how do you play the sound?

severe meadow
#

playsound("<file_name>")

dense creek
#
import threading

audioThread = threading.Thread(target = lambda: playsound("<file_name>"))
audioThread.run()
#

Creating a thread might be slow I guess

severe meadow
#

ya threading is slower so not using it

#

and i got solution of playing it with playsound

#

nvm can u tell me how do i make the time short till the drum beets?

#

drum beats just for some mini seconds but the song time is 3 seconds how do i trim it those some miniseconds

dense creek
severe meadow
#

nvm got that also can someone tell what to do: when sound plays my game stops like how do i get synchronization

near hornet
#

Also this is a bit more advanced and probably requires brainstorming rather than a pythonic solution but, I'm making a game where the players has stats, example:
120 Speed
100 Strength
250 Agility
130 Endurance

And each fight has 3 random difficulties (Easy, Normal, Hard) I was thinking of generating monsters stats by like:
Count total player stats (speed+strength+agility+endurance)/2 = base stats of the monster then the other half randomly generated, this way the monster stats are always different each fight, so is his hp / damage.

Issue is that I needed to find a balance so that vs normal difficulty players would have ~50-70% chance of winning and vs Hard 25-35% Chance, I'm just not too sure how to go about this if anyone ever worked on a similar project.

(I know I can just roll dice and see who "wins" but I wanted to simulate like, monsters dealt xxx Damage - Player HP= XXXX, Player dealth xxx damage to monster, Monster HP = XXXX, etc)

severe meadow
severe meadow
near hornet
#
async def music(filename):
  playsound(filename)



#### MAIN Function
 await music(filename)

might work not sure

#

need to test it out

#

or just make the playsound an async function

#

and u can just "await playsound(filename)" directly

#

if ur game stops it means u got something blocking the code

brisk pilot
#

Then you maintain your one defined monster and keep things simple.

severe meadow
#

can someone tell what to do: when sound plays my game stops like how do i get synchronization

#

when song is over the game continues

brisk pilot
brisk pilot
#

Things like operating system, what game, through Steam or what, where is the music coming from.

strong wedge
#

guys

#

i need help on simple turtle challenge is anyone here good ?

honest mist
#

hey guys

glossy vigil
#

what should i use to develop games

full heath
shut solar
#

Can someone help me with my text RPG? I've been struggling with it for 2 months and I had to start over like 5 times due to code errors and complexity of the code. The RPG is called Dice Adventures. (I DON'T WANT TO MAKE DICE UNTIL I MAKE THE BATTLE SYSTEM.)

round obsidian
#

@shut solar what specifically do you want to know? this is a very open-ended question, which is why it's hard to answer

shut solar
round obsidian
shut solar
near hornet
#

Okay I need big brain math help
https://paste.pythondiscord.com/ujizefuxax.properties
My issue is that the strength stat is too overpowered, stacking it yields 80%+ winrate and balanced builds get like 30% winrate because strength is too strong(edited)
need somehow to tone it down

round obsidian
shut solar
#

Btw, I need to know what folders I need to make.

round obsidian
#

What do you want to print, then?

#

and what do you mean by "folders?" as in, in your project directory? At first you don't need anything

#

@shut solar

shut solar
round obsidian
#

@shut solar Then what do you want to do?

shut solar
round obsidian
#

for simple projects, you can put all the modules in one directory for starters. Over time you can organize things into subfolders if they get unwield.y

shut solar
round obsidian
#

@shut solar you just said you don't want to print anything???

round obsidian
#
class Character:
    def __init__(self, name):
        self.name = name
    def __str__(self):
        return self.name

jordan = Character("Jordan")
party = [jordan]
print(party[0])
# or, if you specifically want the name and nothing else
print(party[0].name)
#

overloading __str__ on a class lets you control what gets printed when you print the object

sharp ferry
#

cant get the pygame.draw commands to work at all. Pygame is installed and the window pops up but that's it

#

I can change the background color though

tribal rock
#

hey guys, im currently working on a reinforced learning with gym open ai and facing some issue that i dont know how to resolve

round obsidian
tribal rock
#

oh ok

#

thank you

dawn quiver
#

i dived into unity blind now idk how to place objects

gusty mason
#

ursina is teh best

rare spoke
#

What is the best game dev engine that supports python code?

short silo
#

Im working on ursina, what i want is if i click the block(self) then it'position += delta(it'position = mouse position) but i dont know why it make eternal loop, please help me

boreal mica
#

Im making a 3d game with OpenGl and Pyglet.

Is pyglet.gl faster than PyOpenGL?

severe meadow
#

someone help me with this
self.tk.call(what + (sequence, cmd))
_tkinter.TclError: specified keysym "Up" for non-key event

#

h=turtle.Turtle()
def move():
h.speed(10)
for i in range(5):
h.shape("turtle")
h.color("green")
h.dot()
h.fd(100);h.lt(144)
h.onclick(move,"Up")

potent ice
#

It doesn't really matter what you use to be honest. It can be changed later

severe meadow
#

where do i learn pygame?

#

which tutorial is best?

#

or there is some good docs of pygame somewhere?

patent urchin
severe meadow
#

but docs not good

patent urchin
#

um

#

do you need examples for learning pygame?

severe meadow
patent urchin
#

if you do

severe meadow
#

i m starting from very basic

#

so...

patent urchin
#

then, TechWithTim on YouTube

patent urchin
severe meadow
#

ya then whose?

patent urchin
severe meadow
#

thnx will see

#

and

#

is docs somewhere?

#

umm some questions

#

it necessary to use pygame.display.flip() at end of every code?

#

and also pygame.quit()

patent urchin
#

yes

#

like make the window stop only when you press the cross button and not automatically, you must put the pygame.quit() at the end of the closing condition

#

which is mostly like this:
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()

patent urchin
#

for example you blitted a picture on the screen, you must pygame.display.flip() at the end to show it on the screen

past pecan
#

OK

#

Which liberty do I use for gui games?

patent urchin
#

anyways i dont know, i have not made gui games often, but you can try with pygame too

shy sinew
# past pecan Which liberty do I use for gui games?

there are many libraries out there that you can use for making games in python, but for beginners i guess pygame is a good option, although it is slow, it's easy to use and good for learning about game dev, but there are plenty of others you can try out

#

i'm just assuming you are a beginner though

past pecan
honest mist
#

hey

#

guys

#

anybody tell me here how can i learn to make malware in python

patent urchin
#

nope..

#

lol

frank fieldBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

dawn quiver
#

hey

patent urchin
#

?

dawn quiver
#

What game engine would you guys recommend for a pokemon-like game with over 1000 sprites in total.

dawn quiver
#

I don't know how to do it however...

round obsidian
dawn quiver
#

trolling troll

patent urchin
dawn quiver
patent urchin
#

i am not sure of it, but i have heard that is a good place for games like these

#

and also you must know C++

#

hehe

severe meadow
#

is there a place for good pygame docs??

patent urchin
#

um

#

not that i know of

#

i usually just do trial and error with my programs

#

or check in internet for my problems

#

or sometimes

#

uhh

#

wait let me check

dawn quiver
#

(me who just plagiarised about half of my code, then tinkered with it)

patent urchin
#

it is good itself, but ya it is confusing most of the times and it is a not a doc

#

it is a forum so most of your problems might not match with them

dawn quiver
#

99.9% of coders:
Hippity Hoppity, your code is now my property
The last 0.1%:
(Makes own code)

patent urchin
#

ya they are the ones whose program gets copied

#

XD

dawn quiver
#

If you can make good code without taking a single line from someone else, welcome to the land of gods

dawn quiver
patent urchin
#

ya

#

so

#

what are you working on?

dawn quiver
#

Animon

patent urchin
dawn quiver
#

ok

patent urchin
#

right?

dawn quiver
patent urchin
#

ok

#

so like will they have real pokemons in it?

dawn quiver
#

Much more complex though, with a better storyline

patent urchin
#

oh

#

cool

dawn quiver
patent urchin
#

well i dont even know real pokemons except bulbasaur, charlizard (right spelling?)

patent urchin
#

so like mixture of them both

dawn quiver
patent urchin
#

ok

dawn quiver
patent urchin
#

my friends used to play with them and i would remain clueless XD

dawn quiver
#

XD

#

Well, when it is done, the server and itch.io page will be in my desc

patent urchin
#

ok

dawn quiver
#

Heck yeah

patent urchin
#

i have never done that

dawn quiver
#

Same here

patent urchin
#

lol

dawn quiver
#

Maybe I might have it cost a bit?

#

Not 100% sure

patent urchin
#

is it like? an io platform?

patent urchin
dawn quiver
#

Nope, a game sharing website

patent urchin
#

like how much?

dawn quiver
#

$5

patent urchin
#

phew

dawn quiver
#

For a beta version

patent urchin
#

i have not a penny with me

patent urchin
#

man well it is your wish

dawn quiver
patent urchin
#

even i plan on making a paid game

#

what? like for full release free and beta $5 and alpha $1?

patent urchin
dawn quiver
#

$1 AUD beta, Alpha is only for game reviewers, full is free (unless you want premium)

patent urchin
#

ok

#

well features in premium?

dawn quiver
#

All starters, legendary's (if any), and more I haven't decided yet

patent urchin
#

just wanna ask something off-topic, what is your nationality (please dont mind)

dawn quiver
#

Australian

patent urchin
#

oh

#

you are close

dawn quiver
#

owo

patent urchin
#

I am an Indian

dawn quiver
#

Nice mate

#

I am in lockdown :P

patent urchin
#

hehe

#

sed me too

dawn quiver
#

sed

patent urchin
#

you are a student?

dawn quiver
#

Yep

patent urchin
#

because i am

#

which grade?

dawn quiver
#

Don't really talk about that sry

patent urchin
#

ok

patent urchin
dawn quiver
#

I am thinking of for my electives, doing coding.

dawn quiver
#

Same grade as me XD

patent urchin
#

really?

dawn quiver
#

Yep

patent urchin
#

cool

dawn quiver
#

Next year, I can choose a couple electives. One of which IS going to be coding

patent urchin
#

i thought when i would come on this server i would see big people

patent urchin
dawn quiver
#

Like rick astley?

patent urchin
#

lol

#

never gonna give you up

dawn quiver
patent urchin
#

never gonna let you down

dawn quiver
patent urchin
#

never gonna run around and dessert you

#

XD

dawn quiver
#

never gonna make you cry

#

never gonna say goodbye

#

never gonna tell and lie, and hurt you

patent urchin
#

XD

dawn quiver
patent urchin
#

who does not

dawn quiver
#

||when I don't rickroll someone||

patent urchin
#

it is a voluntary function of our brain

patent urchin
#

man

dawn quiver
#

I only feel emotions when i send a link

patent urchin
#

to be honest, there hasn't been a person in my whole class who has rick-rolled me

#

my friends are jealous

#

hehe

#

i rick-rolled them literally 30 minutes after New Year

patent urchin
#

swedish music

#

ancient swedish music?

dawn quiver
#

You watching it?

patent urchin
#

nope

#

i will

#

just wait

dawn quiver
#

Ok

#

Make sure audio is on

patent urchin
#

ok is this a rick-roll video

#

with a different name?

dawn quiver
#

?

patent urchin
#

sus

dawn quiver
#

I just like ancient swedish music

#

I am learning it for music this year :P

patent urchin
#

knew it

dawn quiver
#

XD

patent urchin
#

rick

dawn quiver
#

get rickrolled

patent urchin
#

i literally paused the video

#

when i heard that "there are no stages for love"

dawn quiver
#

New record XD
6+9 rickrolls in 24 hours XD

patent urchin
#

really

dawn quiver
#

yes

patent urchin
#

cool

dawn quiver
#

you like dogs?

#

I have a cute dog video

patent urchin
#

i have no pets

#

again a rick-roll

#

nope

#

you play minecraft

#

?

dawn quiver
#

yeah

#

lemme get an image up, it is a QR code to a build i made

#

Can I DM it to you @patent urchin ?

patent urchin
#

k

#

sure

patent urchin
#

why so?

dawn quiver
#

i haven't done anything

patent urchin
#

it is easy actually

#

bruh

dawn quiver
#

plus, it needs so much work

patent urchin
#

for me it just took 3 days

dawn quiver
#

the only stuff I have done is the levelling system (taken from someone)

patent urchin
#

of 3 hours one day

#

of course i have not that much time now

dawn quiver
patent urchin
#

but during holidays

patent urchin
#

about

#

wait let me check

#

8 commands

#

3 events

#

and a logging system

dawn quiver
#

ok

patent urchin
#

like a log file

#

to store conversations

patent urchin
#

i have a server

#

and a YT channel too

#

you?

dawn quiver
#

i am making these commands:
!rank
!rules
!prefix (prefix)
!swearAllow (yes/no)
And more

dawn quiver
patent urchin
dawn quiver
patent urchin
#

uh haha (weak laughter)

#

see i could help you

#

not a big deal

#

but i am not free that much

dawn quiver
#

No thanks

patent urchin
#

ok

dawn quiver
#

Yeah

patent urchin
#

man

#

i would seriously recommend you

#

to not use online stuff

#

see

dawn quiver
dawn quiver
patent urchin
#

internet problems could stop you from working, and then performance

patent urchin
dawn quiver
patent urchin
#

install pycharm

#

do the programming

#

see if it works

dawn quiver
#

wats pycharm

patent urchin
#

and then upload to repl

patent urchin
dawn quiver
patent urchin
#

it is an offline editor

dawn quiver
#

oh ok

patent urchin
#

it is a very good editor

#

i use it for many of my own projects

#

you can go here

#

and click the community one to download free

dawn quiver
#

I am just going to quickly send my code for my bot rn

patent urchin
#

where?

#

here?

dawn quiver
#

nope

patent urchin
#

ok

dawn quiver
patent urchin
#

your program is pretty good

#

like i see no problems

#

except some polishing

#

and it is actually copied

#

XD

solar birch
#

hi guys, can I learn everything, if not a lot about a programming language by making games? or will I also have to do projects in different categories?

tranquil girder
#

yes, but you won't learn modules that are irrelevant to game development
I think you should do projects you're interested in, that's the most important part

patent urchin
#

to me, you should try small scale projects with every type of programming.

dawn quiver
#

in PyGame, should I make sprites for like background images like sky and stuff

low plinth
#

who do DL projects here?

finite solar
#

Can't open an xml :

foggy rain
#

How to make a running image in pygame i mean like Google dinasour game it run and the level is loading

foggy rain
#

Lol bro

raw plaza
#

Hi

#

Will you tprank

#

Will ypu prank

snow hill
patent urchin
#

me too, but for school i have to use that repl.it

brittle meadow
#

I never learn python at school...

wintry cove
mellow onyx
#

hey i have a doubt can we make a game using python in unreal engine

#

or anyother engine , need to make a game like minecraft or an openworld

#

any suggestions?

lunar venture
#

You can use Python with Godot

dense ether
foggy rain
#

This will work?

dense ether
#

It looks like it run

foggy rain
#

I think no

dense ether
#

Then make it run when u press a/d

foggy rain
#

Oh

#

I will test

dense ether
#

Image from sideview if moving

#

And front if not moving

#

U get a point?

compact steeple
#

ok so i have a question

#

i have a set and i want it to print out the numbers in different lines. But i also want a full stop at the end of all those numbers
so like this
1.
2.
3.
and so on, and the set consists of all those numbers

#

i figured out how to sort those numbers, but its not letting me print out the set values along with a string

round obsidian
#

@compact steeple what code do you have so far?

compact steeple
#

List = [1, 2, 3, 4, 5, 6, 7, 8, 9]

List = sorted(List, reverse = False )

#

the sorting part isnt really necessary but i was tinkering so i found it out

#

i need all those values to sorta drop down, like in a list

#

and have a dot(.) at the end of it

round obsidian
#

is this in the terminal or what?

compact steeple
#

im learning on sololearn

#

so its their coding platform

round obsidian
#

I haven't used sololearn

#

is the output just being printed to the console?

compact steeple
#

yeah

round obsidian
#
for item in item_list:
  print (f"{item}.")
compact steeple
#

ah alright ill do that

#

thanks

#

OHHHHH IT WORKS
THANKS SO MUCH

deep thunder
#

how do you display something?

verbal verge
#

heya!

#

can someone tell me a website for free game assests?

#

sprites to be particular

deep thunder
wintry cove
#

??

dusty kite
#
self.surf = pygame.image.load("jet.png").convert_alpha()
pygame.transform.scale(self.surf, (30, 30))
```Why is my image not transforming?
wintry cove
#
<html>
<head>
<meta charset=utf-8>
<title>My web page </title>
</head>
<body>
<h1>Welcome</h1>
<p>Hello!</p>
<p>Get to know more about Html </p>
<a href="https://www.w3schools.com/html/default.asp">Here is the link</a>

</body>
</html>```
gentle hemlock
lunar venture
#

Sublime is not a game engine as far as I know.

mellow onyx
#

hey any unreal engine developer

hushed flax
#

Uhm

#

Nvm

lapis loom
#

Is there any info i can get on run length encoding on 3d block/voxel model?

bronze vector
#

seriusly, i did not know we can make games in python! lol!

dawn quiver
#

How do i rotate the window horizontally in pygame

stone edge
#

Hello, i have mini project for school. And i am going nuts. I created a button but the button does not want to store a variable permanently

#

it only changes the varible eveyrtime i click on it

verbal verge
#

hey

#

anyone up?

#

I have a bug and the general chat seems to be a little busy ๐Ÿ˜…

dawn quiver
#

Hey everyone,
I have taken part in a Codeathon and the topic for my age group is game development

#

Idk what to do and where to start, any help?

#

I need some reliable sources to leafn

frozen knoll
#

The full Arcade 2.6.0 release is out!

#

If you aren't familiar with it, Arcade is a 2D game library based on Open GL.

#

We've been working really hard on this release all summer.

#

There's a ton of example code and tutorials on the website.

shut onyx
#

!ban 338942315127242762 racism

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied ban to @glass flicker permanently.

knotty flicker
#

Ban such peoples

#

||Sowwy for ping||

dawn quiver
#

Sorry to ask, but are there any implements of pyjs for python 3.9? Because I tried using to compile a pyjsdl file with pyjsbuild but resulted with a internal syntax error.

#

Oh wait

#

there are help channels

#

mb

dawn quiver
#

How to change how often pygame.time.set_timer works

#
pygame.time.set_timer(obstacle_timer, THIS_VALUE)
#

it seems that every way I did try doing it it either doesnt work or breaks my game :(

#

I want it to change so lets say at start "THIS_VALUE" is 1000 and then ```py
if score > 20: THIS_VALUE = 500

rocky herald
#

Hi everyone

frank fieldBOT
#

Hey @rocky herald!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

โ€ข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

โ€ข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

rocky herald
#

The problem has changed now, the arrows in the game are not shooting properly

#

Its very rigid and falling very close to the bow

#

This is is the arrow shooting code

dawn quiver
#

Does someone know peoples that can make game intros? Like voodoo style kinda

wintry cove
#

hey hey

#

anyone

#

who had made a game like minecraft

#

or anyother 3D or open world game

#

pls tell

rocky herald
tranquil girder
coarse thorn
#

whatttttttttttttttttttttttttttt>?

wintry cove
#

open world games??
\

viral wing
#

is this game like minecraft

rocky herald
#

Kindly, please

patent urchin
#

i think it might be the logic of the arrow's speed

#

ya and you just have made the self.velocity.y but not the self.velocity.x

#

so you should do this

#

self.velocity.y += (gravity/self.velocity.x)

#

and

#

self.velocity.x += <any speed>

patent urchin
#

just makes it move very rigid and close

#

and fall straight down

rocky herald
patent urchin
#

yep

rocky herald
#

ok

patent urchin
#

did it work?

rocky herald
#

no

#

Its failing repeatedly

#

The shooting is done

#

But not the collision

frank fieldBOT
rocky herald
proper peak
rocky herald
#

The arrow is shooting properly now

#

can you check the collision

#

Its inside arrow class

patent urchin
#

ok

patent urchin
patent urchin
#

so it will look exactly like an arrow being shot

proper peak
#

how's that related to the horizontal velocity though

#

I mean, if you shoot the arrow up, this would mean it would instantly land

patent urchin
# rocky herald can you check the collision

and now for the collision, i will tell the exact solution after a bit of think ok? but till then, i will tell you my experience with using this, you need to create a logic for checking whether the x and y position is equal to the object's or something like that

patent urchin
#

and by zero i mean the bottom level

#

not the actual zero

#

ok fine

#

let me rewrite

#

say for example the screen resolution is 1280 x 720

#

then

proper peak
#

I'm saying that the acceleration per unit of time due to gravity should be constant.

patent urchin
#

if level == 0 or level == 720; arrow.stop

proper peak
#

Not dependent on anything, and certainly not inversely dependent on horizontal speed. That'd mean that the faster you move, the lower gravity affects you - that's not the case.

patent urchin
rocky herald
patent urchin
#

and it works fine as he says

patent urchin
#

so now create a logic

#

for me, i was trying with buttons

#

so

#

if Xpos < mousePosX < Xpos + Width:
if Ypos < mousePosY < Ypos + Height:
hover = True
else:
hover = False
else:
hover = False

rocky herald
#

Yah exactly

patent urchin
#

this was my logic for the button

rocky herald
#

this also I used

patent urchin
#

but, you are using a circular balloon

rocky herald
#

elliptical balloon

patent urchin
#

ya sorta

rocky herald
#

if you check the Balloon class

#

It has x, y, a ,b

patent urchin
#

ya i checked

rocky herald
#

you are saying something like this:
if (x < pos[0] < x + a) and (y < pos[1] < y + b):
return True

patent urchin
#

ya

#

exactly

rocky herald
#

This is a function already there

patent urchin
#

but that works better for rectangular shapes

rocky herald
#

def onBalloon(x, y, a, b, pos):
if (x < pos[0] < x + a) and (y < pos[1] < y + b):
return True
else:
return False

patent urchin
#

because else it will check the circle like this

rocky herald
#

def burst(self, balloon):

    if onBalloon(balloon.x, balloon.y, balloon.a, balloon.b, self.rect):
        balloon.reset()
        score+=1
#

Then I called this

#

Still not working

#

I tried both methods

#

I figured out the problem

#

The arrow position is always static

#

I will show you a example

#

arrow
<rect(550, 350, 100, 100)>
balloon
<rect(134, 500, 35, 43)>
arrow
<rect(550, 350, 100, 100)>
balloon
<rect(412, 500, 30, 31)>
arrow
<rect(550, 350, 100, 100)>
balloon
<rect(320, 500, 31, 36)>
arrow
<rect(550, 350, 100, 100)>
balloon

#

See

patent urchin
#

this is what it will check the balloon as

rocky herald
#

Yes

#

But if the arrow is static the how can it ever collide

#

the cooredinates

#

not the arrow image

patent urchin
#

ya

#

but

rocky herald
#

So I am not understanding that

patent urchin
#

according to me, you must create sort of a hit box

rocky herald
#

how can I get the runnning coordinate

patent urchin
#

an imaginary one

patent urchin
rocky herald
#

for that also I need the coordinates

#

how

patent urchin
#

how about this

rocky herald
#

it will be better for me to understand

patent urchin
#

we only want the tip to touch the balloon

rocky herald
#

not always tip

patent urchin
rocky herald
#

sometimes a little below the tip

patent urchin
rocky herald
patent urchin
#

um can you show your arrow?

rocky herald
patent urchin
#

in the game

patent urchin
#

see

rocky herald
patent urchin
#

the arrow's tip is only to be touched

patent urchin
rocky herald
#

yah exactly

patent urchin
#

i would say

#

create two different classes

#

one Arrow-Body

rocky herald
patent urchin
#

other

#

Arrow-Tip

rocky herald
patent urchin
#

that could be sort of easy

patent urchin
rocky herald
patent urchin
#

create two parts of arrow

#

and then have a function

#

tip_pos() -> position of arrow tip as tuple

rocky herald
#

It will mess with my all over code

#

I don't know how to fix them again

patent urchin
#

ok

rocky herald
#

I have very difficulty solved the shooting problem

patent urchin
#

see i have been through this entirely changing of program, but in classes and objects in some cases, these need to happen, but for safety store the program in another file

rocky herald
#

okay

#

stored

patent urchin
#

ok

#

now

#

that you have a backup

#

create two classes

rocky herald
#

now tell me what to write in the arrow tip and body function

patent urchin
#

um

#

body will determine, the movement speed

#

and

#

tip will determine, the touch, and will be stuck to the body's front part

#

and you dont need to write everything, use the back up to take in all the logics back

#

hey i have an idea

#

for the hitbox

#

how about

patent urchin
#

we simply create a line (transparent and imaginary, not to be printed on screen) tangent to the arrow's uppermost tip

rocky herald
#

ok

patent urchin
#

then it will be simple rectangular touching logic

#

if it touches, well and good

#

and if not

#

then

#

um..

#

i mean, if the rectangle is touching the balloon, well and good, else do another try

rocky herald
#

class ArrowBody:
def init(self, pos, velocity):
self.velocity = velocity
self.image = pygame.image.load('balloonshooter/arrow.png')
self.image = pygame.transform.scale(self.image, [100, 100]) # make the image a bit smaller
self.rect = self.image.get_rect(center = pos)
#self.rect.center = pos
self.available = True

def move(self):
    #if not self.availible:
        # self.velocity.y += gravity  # apply gravity
    self.rect.x += self.velocity[0]
    self.rect.y += self.velocity[1]
#

Can you add to this

patent urchin
#

um

#

let me see

rocky herald
#

because body will contain the image

#

so i put it their

patent urchin
#

yes

#

but only of the body

rocky herald
#

ofcourse the body will also have velocity

patent urchin
#

the tip will have different image

#

ok but you could also do this, to have a cleaner image

#

make the tip with no image at all

#

it is the imaginary rectangle

rocky herald
#

yah that can be the imaginary rectangle

patent urchin
#

yes

#

now it will be more easier

#

so make the body have all same logic for the movement

#

and the tip will be a rectangle

#

with width 0

rocky herald
#

what to write in arrowtip class

patent urchin
#

do this

rocky herald
#

in the init function

#

I need not touch the body, right?

patent urchin
#

yes

#

but

#

the tip should not be seen

rocky herald
#

ok

patent urchin
rocky herald
#

for that I will need the coordinates of the tip

patent urchin
#

no

#

just do this

#

do you know the length of your arrow pic?

#

if you do

#

then

rocky herald
#

original no

#

the resized one yes

#

100,100

#

after transformation

patent urchin
#

make the imaginary tip be blitted on the screen at the X, Y pos of the arrow but X+length

patent urchin
placid mortar
#

does everyone know how i can make a rpc for my game or software in python?

rocky herald
patent urchin
#

ya so

#

the length is needed right

#

you will be blitting the tip like this

#

the Xpos of the arrow's body + its Width (ya not length)

#

it is width not length my bad

rocky herald
patent urchin
#

anyways the value is same only

rocky herald
#

okay let me create the class

patent urchin
#

100

#

yes

rocky herald
#

how to create a transparent rectangle?

patent urchin
#

um

#

like a rectangle with no colors

rocky herald
#

okay

#

I think once its drawn it doesn't need to be blit

patent urchin
#

ya

rocky herald
#

pygame.draw.rect(surface, color, pygame.Rect(30, 30, 60, 60), 2)

patent urchin
#

yes

#

that is mostly what i use

#

so that i dont need to blit it

rocky herald
#

class ArrowTip:
def init(self):
self.x = 200
self.y = 100
pygame.draw.rect(surface, (255,255,255), pygame.Rect(self.x, self.y, 0, 60), 2)

#

Is this fine

#

?

patent urchin
#

um

#

but this will create a white line

#

and also

#

we need it to be 0 width the rectangle

rocky herald
#

yah done

#

not showing on screen though, after creating the object

patent urchin
#

yes

#

so that is what is needed an invisible line

rocky herald
#

no even when I changed the color its not showing

patent urchin
#

which will check if it has been touched by balloon

rocky herald
#

yah

patent urchin
#

um lol?

frank fieldBOT
rocky herald
#

please check once

patent urchin
#

self.x+width

#

do this

rocky herald
#

ok

#

self.x+width what?

#

top, left, width or height?

patent urchin
#

the pygame.Rect

#

width

rocky herald
#

ok

patent urchin
#

see

#

in line 199

#

do

#

pygame.draw.rect(display, (0,0,255), pygame.Rect(self.x+widthofArrowBody, self.y, 0, 60))

rocky herald
#

yah that only

#

done

patent urchin
#

now check

rocky herald
#

self.x = 200

patent urchin
#

ya

rocky herald
#

self.y = 100

patent urchin
#

no

#

self.x+100

#

reason

#

we dont need it to have a width

#

it must have x

#

pos

rocky herald
patent urchin
#

where it needs to be drawn on screen

rocky herald
#

as you said

patent urchin
#

yes

#

300

rocky herald
#

class ArrowTip:
def init(self):
self.x = 200
self.y = 100
pygame.draw.rect(display, (0,0,255), pygame.Rect(self.x+100, self.y, 0, 60))

#

nope, not working

patent urchin
#

ok

#

um

#

let me use your program once for myself

rocky herald
#

I created the object just below it

patent urchin
#

i will come back in 5 minutes after a thorough research

rocky herald
#

sure

patent urchin
rocky herald
#

no problem

rocky herald
patent urchin
#

you just have one file right?

rocky herald
#

yah

patent urchin
#

ok

true cedar
#

yo how to make a player press a button everytime they wanna do something not hold it down but press it

patent urchin
patent urchin
#

um

#

it wont work or else right?

true cedar
#

in pygame btw

frank fieldBOT
#

Hey @rocky herald!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

patent urchin
#

i have done it pretty easy

rocky herald
patent urchin
#

ok

#

just these?

rocky herald
#

@patent urchin these are the images

true cedar
#

wait so you made a class? on how to do the thing?

patent urchin
#

um can you wait for approx 10-25 minutes, i gotta speak with my parents for something lol

patent urchin
#

but a bit later please

true cedar
#

aight

#

oh wait nvm i got it

patent urchin
#

ok

patent urchin
#

hey

#

i have a question

#

@rocky herald what are these:
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

#

where have you mentioned that srgb profile?

rocky herald
#

These are just warning

patent urchin
#

no i know

patent urchin
rocky herald
#

no no

patent urchin
#

no no?

rocky herald
#

I didn't mention any such profile

#

I simply loaded the images

patent urchin
#

but when i am clicking

#

the target

#

is going

#

i mean

#

the color i think is messing up there

rocky herald
#

which color?

patent urchin
#

see here

rocky herald
#

the arrow tip?

patent urchin
#

i am sending a video after some time

rocky herald
#

ok

patent urchin
#

just as i click

rocky herald
#

Yah I also got those warnings

#

yes

patent urchin
#

so what did you do to solve?

#

because i have done some modifications in the motion

#

as well as the Arrow tip

rocky herald
#

I am not sure what are those about, these happen when the arrow and the bow images are loaded

rocky herald
#

yah

patent urchin
#

so how did you solve

rocky herald
#

if the remove the images then no warning

patent urchin
#

lol

rocky herald
rocky herald
patent urchin
#

i have one more question

#

do you know the output type of the self.rect?

rocky herald
#

yah

#

yah

#

let me show

patent urchin
#

over here

#

show

rocky herald
#

arrow
<rect(550, 350, 100, 100)>
balloon
<rect(581, 500, 31, 35)>

#

Its like this

patent urchin
#

ok

rocky herald
#

pygame.Rect

patent urchin
#

so which one of this in the arrow is the width

rocky herald
#

so 100

patent urchin
#

ok

#

hey

#

can you get the value as

#

self.rect[2]

#

hello?

#

ok

rocky herald
#

I am not sure what is the underlying data structure for pygame.Rect

patent urchin
#

ok

rocky herald
#

If its a list then it might

patent urchin
#

ok fine

rocky herald
#

Is the arrow tip showing on the screen?

patent urchin
#

um wait

#

it is not supposed to show

#

but i saw you have changed the color

rocky herald
#

As in with other color

#

just to make sure its appearing

patent urchin
#

ya

#

can you make the color black

#

um i can make it on my own

#

lol

#

i forgot

rocky herald
#

yah its 0,0,0

rocky herald
patent urchin
#

ya i tried doing some changes

#

i have a better solution

#

do this

#

create a blank image

#

and i would recommend gimp

#

for this

#

create a 10x1 transparent image

rocky herald
#

using?

#

pygame?

patent urchin
#

GIMP

#

no

#

an app

rocky herald
#

I can do it in opencv

patent urchin
#

no no

#

not like thhat

#

create a transparent image in gimp and then blit it as the arrow tip

rocky herald
#

I will have to download gimp

patent urchin
#

yes do it

rocky herald
#

It will take a long time to complete

#

Is there any other workaround

patent urchin
#

um it is necessary

rocky herald
#

ok

patent urchin
#

because if you want a transparent image

#

it is the best way

rocky herald
#

Why can't you just create a rectangle

patent urchin
#

i am not talking about me, i have never seen a rectangle drawn in pygame

#

which is transparent

rocky herald
#

ohk

patent urchin
#

i have always seen and worked with colorful rectangles

rocky herald
#

umm the rectangles have a rgb value. right

#

?

patent urchin
#

yes

#

and there is no such value for transparency in rgb

rocky herald
#

yah it can be done

patent urchin
#

can it?

#

be done?

#

transparent color in rgb

rocky herald
#

what if the rectangle is the same color as lightBlue = (174, 214, 241)

patent urchin
#

because 0, 0, 0 is black

rocky herald
#

because background is lightblue

patent urchin
#

um it will become visible when passing a balloon of some other color

rocky herald
#

also can add

patent urchin
#

it is best to blit it, it is the fastest way (during runtime) and also better way

rocky herald
#

174, 214, 241,0.5

#

try this

patent urchin
#

0.5?

rocky herald
#

transparency

patent urchin
#

will try

#

right now

#

it actually might have worked

#

but the srgb profile is still there

rocky herald
#

I am not getting

#

what is srgb

patent urchin
rocky herald
#

yah I know

#

I meant what is srgb

patent urchin
#

i guess

#

r=red

#

g=green

#

b=blue

#

but what is 's'?

rocky herald
#

I too don't know

#

But it is a warning

#

there is no reason why the rect is not showing

patent urchin
#

um it completely kills the process

rocky herald
#

gimp will take a lot of time to download, given my network, and if it does my ram id far too weak to handle it, I think

patent urchin
#

ok

#

then use some transparent image

#

from google

#

can you try it with paint?

rocky herald
#

okay

#

In paint what color do you want me to create it of

patent urchin
#

um

#

just something transparent

rocky herald
#

ok

patent urchin
#

anything but a 10x1 pixel transparent image

rocky herald
#

In paint its like this

patent urchin
#

no

#

it must be transparent

#

i am telling you, it is better with gimp or if you can find some app in the internet

#

see i got this

rocky herald
#

yah this I got

patent urchin
#

do this

#

with this

#

i have done till here

rocky herald
#

as in blit this?

frank fieldBOT
#

Hey @patent urchin!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

โ€ข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

โ€ข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

patent urchin
patent urchin
#

i have done till here

#

made some tweakings

#

and got stuck at the srgb

#

also

#

change the picture directories for bow and arrow

ruby forge
#

hello guys i created a clone of microsoft pain in pygame

#

i also add paint bucket tool to fill colors inside of shapes