Okay, few days back I started to make a top-down scroller shooter with TGF in style of raptor etc. Everything went fine except now. I would complete the demo of the game but there are some major bugs that prevent that.
1. The game crashes on some occasions, one is that when I set the tanks bullet to destroy if it is getting close to windows edge, that seems to crash the game, with that thing I tried (and mainly succeeded) to prevent the enemies bullets coming even when they are not on the screen. If there's a better solution for that, it would be just great.
2. TGF has a limit for active objects? right? well, sometimes that seems to prevent the player from shooting, any solution?
3. The game crashes sometimes randomly (like when the player dies), or without a reason that I'm avare of.
I think these are the major problems, I have uploaded the "source", so if anyone would be kind enough and have the time to look at it and give me a helping hand, that would be just great. Awesome to be more specific actually.
I can aswer the second question:
The reason why there are too many objects is, that the enemies shoot bullets even outside the window.
Create an object, call it "center" or whatever, make it invisible, place it at (260,300) (y=300 is more important in your case), uncheck "follow the playfield". So that the object will now flow exactly in the middle of your window.
You made your event like this: every x seconds-> ("cannon") shoots a bullet
Insert these conditions:
Y position of ("cannon")> Y("center")-300
Y position of ("cannon")< Y("center")+300
This way the cannons will only shoot when they're in the window. Do the same for all other enemies
Tip: create a counter and place it on the top right corner of your playfield, create event: always-> set couter to nobjects
This way you can always check how many objects there are in your game
just delete the counter when you release it.
Did Nuutti Hölttä [GameCyborg] ask you to buy multimedia fusion? Don't listen to him. Your game can be easily created in TGF. Good luck with it.
MMF is much more stable than TGF, so TGF might just be randomly crashing because it can't handle your game. Also TGF becomes very unstable once you hit the object limit, so you should try to stay well under it.
What's the module name of the crashes? If it's a .GOX file, that extension is causing the crash.
wasnt there an event limit? im sure KnP had one. i made a game years ago called Hex which was a top-down shooter with bucket loads of guns and lots of juicy events, but it would crash whenever the player entered the levels.
Hm, that's quite a big problem isn't it? Yes, the event limit was something low but higher than 600, and in MMF it's gone up to 4096 visible event lines (so you can have stuff in groups which bring the total to over 4096). However, if you actually reach that limit without groups, you're probably doing something really inefficiently anyway.