need help on a bullet coding using a bitmap image

BlitzMax Forums/BlitzMax Beginners Area/need help on a bullet coding using a bitmap image

delbar(Posted 2005) [#1]
I have been trying to use Deux's example to get my guy to be able to fire his weapon , but it uses a created and grabimage approach, my hopes are to use a loaded bitmap image. I can get it to fire and you see it for a second inside my sprite of a guy, but then it disappears and doesnt go any farther, can't get it to extend its range no matter what I do. Also it seems that Deux's example is extensive , is there a shorter easier version using a loaded bitmap. Any help would be appreciated, been trying for 2 days now, I am about as green as they come to programming.


bradford6(Posted 2005) [#2]
can you describe what you are trying to accomplish?


SillyPutty(Posted 2005) [#3]
hey delbar, how was my example extensive ? :)

cant you just replace the bullet with an image ?

can you post your code here ?


delbar(Posted 2005) [#4]
Hello Deux

I tried to just replace the code where the dynamic image was with a .bmp image that i made but it didn't seem to work, the best i could get was when I hit the left mouse( I changed the space bar on yours to it ) was to get 1 or 2 buttlets to show up inside my sprite but not go across the screen. I changed your originX&Y to my sprite image to get it to shoot from there. If I knew how to post code here I would , for now let me check out how I can. But that is the end result I got trying to convert your code to an image, I also took out scale_factor and alpha_factor , not sure if I should have , I used life where alpha_factor<0 to delete from the bulletlist.


delbar(Posted 2005) [#5]
Test trying to post my code. Am trying to get an bullet image(bmp) to shoot from my sprites gun and travel across the screen either to a certain distance or off the screen or stop when it hits something( collision to come later)




delbar(Posted 2005) [#6]
hiya , guess my posting the code didnt work to well other then posting it like text, didn't use one of those cool windows ffor it but there it is. This version I put back in the scale_factor and alpha_factor thinking that somehow it made the bullet go across the screen but it didnt help either. I am sure I am missing something that is probly real easy for most programmers with some experience. If someone could nudge me in the right direction I would appreciate it. Being a newbie to this is ruff.


Beaker(Posted 2005) [#7]
delbar - i've put your code in a codebox. If you edit that post you will be able to see how I did it.


SillyPutty(Posted 2005) [#8]
where in the code archives did you put it ?


klepto2(Posted 2005) [#9]
Hi Delbar:

I have modified your code abit and it should work now. I have changed the imagenames to my needs and bring all bulletfunctions together to the bullet type to make it more OOP. Its not working well (short time to test) but it should show you how to make it.




delbar(Posted 2005) [#10]
Hello everyone

Thanks Beaker for showing me the [codebox] command. Thanks Klepto2 for showing me what I was doing wrong, I have tested your code and it does just what I was wanting it to do, thanks a million! Thanks Deux for helping, although we seemed to be on at different times and I couldn't respond too quickly , I am not sure what you mean by the post " where in the code archives did I put it", nonetheless your code got me going on what I wanted to try and do. The Blitz community seems to be as they advertised when I bought the Blitz+, very helpful and I thank you all for helping out a "newbie".


SillyPutty(Posted 2005) [#11]
no probs man, hopefully we can play your game soon :)

I just wanted to see your updated code :)