pygame

我在干什么?

送分小仙女□ 提交于 2021-01-01 06:46:23
  【本文内容技术含量极低】。但我的哲学是,与其在非技术区写有点技术的博客,何不在技术区写没什么技术的博客呢?   回顾我记录下来的目标,可谓是天花乱坠,这就是我作为空想家(而不仅是自谦为“空想者”)的基本素质。我来整理一下(无序):1.写一部小说(原因1是对人性论点的不满,原因2是希望情感可以被机械模拟,原因3是觉得因此自动生成情节是有可能的,原因4是想整合多年的碎片构思);2.做一部动画(原因1同上几点,原因2是觉得与其建模,不如让机器脑补作画,理论上可以大幅减少运算步骤,并且不止是智能PS那么“简单”);3.写一套编程教材(原因1:学的时候看不懂;原因2:希望找到快速学习方法;原因3:前一条原因引出了“知识是什么”,包括知识表示和分析,和专家系统沾边了;原因4:因此生成教程是可能的,直接由知识的结构生成书,虽然牵扯到接受知识的过程);4.写一本哲学书(1:对常见哲学问题回答的不满;2.希望对零碎之物能有系统分析);5.翻译文档(1.知识表示的范本;2.自然语言之特定领域的分析范本);6.做一个pdf阅读器,加上弹幕和互动功能(1:注释立体化,2:分布式教育和学习,3:时间作品,能看到思维痕迹);7.3d网络课堂(和游戏区别不大,但是我觉得有意义,至少和一般的网课相比);8.ACG自动翻译软件(1:主流翻译器那个复杂啊,我又不怎么玩;2.可以改造成学外语软件);9.开发一个游戏

How do I make smooth movement + rotation in pygame?

≡放荡痞女 提交于 2020-12-31 15:17:12
问题 I am trying to make a spaceship move towards the mouse pointer, rotating to follow the pointer if it moves around. Currently, the rotation works fine and the linear movement works fine, but for some reason if the ship rotates and moves simultaneously, it sort of shakes in place while rotating and doesn't move forward any more. Here is a gif of my problem for clarification. Below I have the relevant code. EDIT: I just posted the entire class to hopefully make things less confusing. class

How do I make smooth movement + rotation in pygame?

风流意气都作罢 提交于 2020-12-31 15:12:36
问题 I am trying to make a spaceship move towards the mouse pointer, rotating to follow the pointer if it moves around. Currently, the rotation works fine and the linear movement works fine, but for some reason if the ship rotates and moves simultaneously, it sort of shakes in place while rotating and doesn't move forward any more. Here is a gif of my problem for clarification. Below I have the relevant code. EDIT: I just posted the entire class to hopefully make things less confusing. class

How do I make smooth movement + rotation in pygame?

不想你离开。 提交于 2020-12-31 15:06:08
问题 I am trying to make a spaceship move towards the mouse pointer, rotating to follow the pointer if it moves around. Currently, the rotation works fine and the linear movement works fine, but for some reason if the ship rotates and moves simultaneously, it sort of shakes in place while rotating and doesn't move forward any more. Here is a gif of my problem for clarification. Below I have the relevant code. EDIT: I just posted the entire class to hopefully make things less confusing. class

pygame issue loading images (sprites)

馋奶兔 提交于 2020-12-31 06:10:30
问题 This is the code: """ Hello Bunny - Game1.py By Finn Fallowfield """ # 1 - Import library import pygame from pygame.locals import * # 2 - Initialize the game pygame.init() width, height = 640, 480 screen=pygame.display.set_mode((width, height)) # 3 - Load images player = pygame.image.load("resources/images/dude.png") # 4 - keep looping through while 1: # 5 - clear the screen before drawing it again screen.fill(0) # 6 - draw the screen elements screen.blit(player, (100,100)) # 7 - update the

pygame issue loading images (sprites)

十年热恋 提交于 2020-12-31 06:09:17
问题 This is the code: """ Hello Bunny - Game1.py By Finn Fallowfield """ # 1 - Import library import pygame from pygame.locals import * # 2 - Initialize the game pygame.init() width, height = 640, 480 screen=pygame.display.set_mode((width, height)) # 3 - Load images player = pygame.image.load("resources/images/dude.png") # 4 - keep looping through while 1: # 5 - clear the screen before drawing it again screen.fill(0) # 6 - draw the screen elements screen.blit(player, (100,100)) # 7 - update the

How do I add a rubber band for mouse dragging in PyGame? [closed]

五迷三道 提交于 2020-12-26 16:36:34
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . Improve this question I made the second code separate from the first and I wanted to implement the same functionality as the second which is to draw a line with the mouse I made the second code separate from the first and I wanted to implement the same functionality of the second which is to draw a

How do I add a rubber band for mouse dragging in PyGame? [closed]

喜夏-厌秋 提交于 2020-12-26 16:28:25
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . Improve this question I made the second code separate from the first and I wanted to implement the same functionality as the second which is to draw a line with the mouse I made the second code separate from the first and I wanted to implement the same functionality of the second which is to draw a

Python pygame need help disabling multiple keypresses at once [duplicate]

和自甴很熟 提交于 2020-12-26 12:17:07
问题 This question already has an answer here : How to get if a key is pressed pygame [duplicate] (1 answer) Closed 20 days ago . I have created a Frogger Game Prototype and I'm wanting to not allow two keys to be pressed at the same time for movement. currently in my event function I have the following: for event in pygame.event.get(): # check for closing window if event.type == pygame.QUIT: if self.playing: self.playing = False self.running = False if event.type == pygame.KEYDOWN: if event.key =

Python pygame need help disabling multiple keypresses at once [duplicate]

妖精的绣舞 提交于 2020-12-26 12:16:08
问题 This question already has an answer here : How to get if a key is pressed pygame [duplicate] (1 answer) Closed 20 days ago . I have created a Frogger Game Prototype and I'm wanting to not allow two keys to be pressed at the same time for movement. currently in my event function I have the following: for event in pygame.event.get(): # check for closing window if event.type == pygame.QUIT: if self.playing: self.playing = False self.running = False if event.type == pygame.KEYDOWN: if event.key =