[SOLVED] How to make multiple bullets (with png) and move at similar time by using Pygame? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

[SOLVED] How to make multiple bullets (with png) and move at similar time by using Pygame?

I have been making a boss fight with Pygame, I made the boss move by the edge, and change the direction by changing a var called phase, and the boss will make bullets while moving, however I just could make 1 bullet and only 1 direction. I need help. (btw I can't give the code in the comments because I only use Sololearn on phone)

29th Feb 2020, 3:27 AM
Chaney Chan
Chaney Chan - avatar
7 Respostas
+ 3
i think it comes down to your code design, you should create multiple bullet objects on each game loop to instantly create multiple bullets at the same time. and create another method to enable the bullet to move at a certain degree or direction. we still can't help you much if you don't provide the codes that you are referring to.
29th Feb 2020, 7:57 AM
Shen Bapiro
Shen Bapiro - avatar
+ 2
Without code it would take many questions and answers to just get an idea of how your code works. It is best to post your code if you want a good and reliable answer. You can connect to your SoloLearn account on your computer, and then copy-paste the code.
29th Feb 2020, 3:40 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 2
ä½ ēš„make bullet function č£”ęœ‰č¦ęœ‰äø€å€‹dictionary ļ¼ŒäøåŒēš„phaseęœƒå¼•ē™¼äøåŒēš„å­å½ˆę–¹å‘ć€‚ å¦‚ęžœé‚„äøę˜Žē™½ļ¼Œęˆ‘åÆ仄åœØé€™č£”ē”ØJavaScript 做äø€å€‹ē°”單ēš„ē¤ŗēƄ ļ¼ˆęˆ–č€…å°‡ä½ ēš„sourceę”¾äøŠgithubļ¼Œå°‡github repoēš„link shareåœØé€™č£”ļ¼‰
29th Feb 2020, 3:43 AM
Gordon
Gordon - avatar
+ 1
lvl 1 crook Thanks, I have solved the problem!
29th Feb 2020, 9:29 AM
Chaney Chan
Chaney Chan - avatar
+ 1
awesome Chaney Chan , happy to help :)
29th Feb 2020, 10:29 AM
Shen Bapiro
Shen Bapiro - avatar
0
I think I might post part of the bullet code soon
29th Feb 2020, 4:50 AM
Chaney Chan
Chaney Chan - avatar
0
lvl 1 crook l think that you are right, I will try it soon when I get my hands on my pc.
29th Feb 2020, 8:02 AM
Chaney Chan
Chaney Chan - avatar