-
Notifications
You must be signed in to change notification settings - Fork 311
Return a map of Bodies from an array #49
Comments
You are wonderful. |
@kjin9174 I am using react native (the mobile development version of react) and you are using react(the web version) Our code will be similar, but not exactly the same. I am not going to write you a full-out checklist or anything, because the real triumph is learning how to come up with those steps yourself. To start, know your vocabulary. React is also known as "ReactJS" because it is written in JavaScript, and JavaScript has nothing to do with Java. Node is, from my understanding, is basically the way in which you can install external libraries and other people's addons such as this game kit. In order to make an app or website, you probably will use one or more libraries and will need to read the "Docs." This is essential, because each library has it's own uses and specifications you will need to adhere to. I would advise starting small, maybe making an extremely simple flappy bird game. Work up to making whatever game you are wanting to create. React is a big learning curve, but it is very do-able. A library called MobX is a very helpful library in javascript due to its easily modifiable global variables(state.) Good Luck! |
I still need help though. If anyone knows a solution to my problem that would be appreciated |
@katzmannn -- Can you give us a code sample of what you're trying to do to help with more specificity for our understanding of the issue? Thanks! Either code snippets here if apparent, or create a minimal repo with what you're trying to do and getting stuck on (and actually using react web would be preferable for ease of diagnosis, but RN's ok too). Then provide install + running steps + what to look for going wrong. |
Thanks for your reply. class Game extends Component { export default Game; but this is error
It seems like that i don't know method that use tags of react-game-kit package |
@kjin9174 is your query related to @katzmannn 's issue with multiple bodies or do you have a separate issue / are you just trying to learn react-game-kit? If the latter, can you either open a new issue or maybe ask on stack overflow to get help? Thanks! |
ok,cool |
wait nevermind, this actually creates infinite enemies lmao |
How do you do this? |
@katzmannn -- I'm not quite following. Can you open up a minimal repository with install + error reproduction steps so we can jump in and see what's going wrong? Will greatly help us diagnose the core issue! |
@ryan-roemer I am basically trying to render bodies in an array. How would I approach this |
I am making a sidescrolling game, and I am rendering multiple enemies in random positions. I am working with the onCollide function so I can easily implement player/enemy collision without messing with pixels and all that jazz. The problem is that when I map an array of random points and for each index, return one custom enemy object, I can't change the reference to the body(The "this.body = b" prop) on each index. This results in each body rendering at the same point and collisions not being logged.
It has to be a body in order to calculate the collisons. I am considering moving to p2 physics for their bodies and keeping sprites and other parts of this library unless I find an efficient solution for this. Thanks in advance
The text was updated successfully, but these errors were encountered: