Way to increment objects inside an array for 2 hit detection c+

后端 未结 1 1568
借酒劲吻你
借酒劲吻你 2021-01-29 15:16

Im creating a basic game using SDL/C++. I need a way to implement 2 hit detection. When just trying one hit it works fine. Here is what i have for the two hit detection:

1条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 16:09

    Yes, this identifies the object on which the method was called. In C++ if you use the this keyword explicitly when accessing a member, you need the -> access operator instead of . because it is a pointer, not a reference.

    But, of course, you would usually just write ++ hits with no this.

    0 讨论(0)
提交回复
热议问题