|
Attack2
Mar 19, 2019 14:57:19 GMT -6
Post by johnno56 on Mar 19, 2019 14:57:19 GMT -6
I have been working on a "non 8 bit" version of 'Attack". It's a bit of a "dog's breakfast" but it works. I would appreciate comments or suggestions as to how to improve the efficiency. A couple of notes: When I made this in sdlbasic, a sprite would go off the screen and I would issue the command to deleted it. I have noticed that rcbasic, when it deletes and image, it's gone and not coming back... instead, I have had to 'draw' the image off-screen. I have fears of memory issues... any ideas? When the player is hit, the explosion, doesn't quite behave itself. Appreciate some suggestions. I am still trying to include a 'play again' feature but my brain hurts.... J www.dropbox.com/s/a0johoh69bs1146/attack2.zip?dl=0
|
|
|
Attack2
Mar 19, 2019 15:50:20 GMT -6
Post by tbird on Mar 19, 2019 15:50:20 GMT -6
I just tried it with modifying the code to not move the bullet off-screen, you are doing it correctly, you have a flag variable "active", and it's working the way you intended..at least it is for me . The bullet disappears when it collides. Also no fears of memory issues for a memory leak you would have had to have an array that re-sized with every bullet shot and it keeping track of each bullet, so ever growing numbers. What you were talking about is simply changing the same set of variables, which has basically zero effect on memory. As for your player explosion issue, you use the "Wait()" command, which actually pauses execution of the program, the whole program...explosion and all lol. So if you need the rest of the game to pause while the player explodes into glory, I would use a "pause" flag variable That controls runtime on everything except that explosion and also background sound, explosion sound etc... so that everything stops moving but the player blows up, and is heard blowing up. If that wasn't clear enough, all your update sub routines and functions could only run if, for example, If GAME_STATE$ <> "pause" Then and for the player explosion If player is hit then pause game and do your exploding stuff... I hope that made sense.
|
|
|
Attack2
Mar 19, 2019 16:57:31 GMT -6
Post by johnno56 on Mar 19, 2019 16:57:31 GMT -6
Ok. For starters... Dog's breakfast, right? lol
I found that wait statement and buried it... Explosion worked fine... Well spotted. Thank you. I had to read through your last paragraph a few times to try and make sense of it. It's not 'you', I'm about as sharp as a bowling ball... The explosion is just a single image. There one moment just before the game ends. I'm not sure if "I" am making sense... It's almost 10am and I haven't had my coffee yet... maybe that's the reason? lol
I think I have had enough of 'shooters' for the time being... My brain hurts too much... Platformers or maybe text adventures? Do you know of any tutorials etc? I think it's caffeine withdrawal....
|
|
|
Attack2
Mar 19, 2019 17:06:21 GMT -6
Post by tbird on Mar 19, 2019 17:06:21 GMT -6
I will give you a quick example of what I mean....I doubt it's either one of us but both....I usually can't explain all that well lol. I will try very hard to write an example as soon as I can.
|
|
|
Attack2
Mar 19, 2019 21:33:05 GMT -6
Post by tbird on Mar 19, 2019 21:33:05 GMT -6
I added what I meant to your code, also added the ability to pause the game by pressing "p". If you wanted to be able to pause the game and have an animation you would have to save location values and run a seperate loop...but I am just trying to show you what I meant, hope it clears things up.
|
|
|
Attack2
Mar 19, 2019 21:40:50 GMT -6
Post by johnno56 on Mar 19, 2019 21:40:50 GMT -6
Click!... and the light goes on! Many thanks for clearing up my confusion. Much appreciated.
|
|
|
Attack2
Mar 19, 2019 22:44:27 GMT -6
via mobile
Post by tbird on Mar 19, 2019 22:44:27 GMT -6
No worries, glad it makes sense now.
|
|