@@ -179,42 +179,3 @@ void handleItems(entity *plr) {
179179 }
180180 }
181181}
182-
183- void handleCombat (entity * plr , int * inputs ) {
184- if (inputs [Atk ] || inputs [Side ]) {
185- for (int i = 0 ; i < world .size ; i ++ ) {
186-
187- if (!BitCheck (world .elements [i ].indicator ,
188- 1 )) { // Checking if it's an item
189- float ePoint = world .elements [i ].sprite .x + world .elements [i ].sprite .y ;
190- float pPoint ;
191-
192- if (inputs [Atk ]) { // Add switch statement here for different characters
193- // if (inventory[1] > 1){
194- int x , y ;
195- SDL_GetMouseState (& x , & y );
196- pPoint = x + y ;
197-
198- inventory [1 ]-- ;
199- printf ("Inventory Seeds: %i\n" , inventory [0 ]);
200- // }
201- }
202-
203- if (inputs [Side ]) {
204- pPoint = plr -> sprite .x + plr -> sprite .y +
205- ((plr -> sprite .w + plr -> sprite .h ) / 2 );
206- cooldowns = BitSet (cooldowns , 2 );
207- }
208-
209- printf ("Enemy Point: %f, Player Point: %f, distance: %i\n" , ePoint ,
210- pPoint , abs (ePoint - pPoint ));
211-
212- hitbox (world .elements + i , i , plr -> components [1 ], pPoint , atk_range );
213- } else {
214- add_item (inventory , Inventory_Slots , world .elements [i ].id ,
215- world .elements [i ].components [0 ]);
216- remove_element (& world , i );
217- }
218- }
219- }
220- }
0 commit comments