Hey there, I'm quite new to Rust, game development and this game framework "ggez". I'm working on my version of Pong.
Thought you might've heard of it and could help me with this little problem that I'm having.
Here you have the code.
https://gist.github.com/earomc/6f89c0bc80f18038e6c24b51a8e364f7
See, in lines 116 and 117 I'm updating the dest parameter of the DrawParam fields that come with the two player struct instances.
I'm updating them based on the pos fields. At least I'm trying to.
As printing out both the pos fields and the draw_param fields reveals that the pos fields are being updated, but the draw_param fields aren't. Looking at examples like the snake example: https://github.com/ggez/ggez/blob/74ed4c7688cdd03a84c5c98f9c8650ec3947cf07/examples/04_snake.rs
They're creating a new DrawParam instance on every draw call.
- I wonder why they do that.
- Why can't I (apparently) change the values of the draw_param fields?
I appreciate every bit of help. Thanks in advance!