|
Post by highrise on Mar 27, 2017 11:29:07 GMT
Hi guys
I can't seem to create an explosion. Basically what I wanted to do was have a small explosion when the player hits a deadly block, i.e like a mine, which would damage the player but not kill them - I will worry about that code later, for now I just wanted to test the explode command.
So I made a screen and a player character, and put a deadly block in his path. I made sure to set specialise->particles, and then I put this simple code as a test in the player control event.
IF deadly EXPLODE 8 ENDIF
I ran the game but nothing happened. Then I put a sound into the code to see if it was running - it was, I got the sound when the character crossed the block, but no explosion.
I tried the same thing with LASER, and that also didn't work. It seems like the particle speciality is not running, I don't know. I also tried it on two different emulators.
thanks in advance.
|
|
|
Post by highrise on Mar 27, 2017 12:01:57 GMT
p.s I also added a small code so it only happens once, i.e I set the variable 'e' to zero at the start of the game.
if deadly if e=1 explode 8 e=0 endif endif
....still nothing
|
|
|
Post by SPECIALIZATION on Mar 29, 2017 1:11:06 GMT
WHAT YOU SELECTED?
|
|
|
Post by alessandro on Mar 29, 2017 22:11:29 GMT
As stated in the manual, you must REMOVE your sprite after the EXPLODE command, and it's also wise to add a counter to avoid the explosion not being displayed due to the KILL command. To do so, put a variable, say L, as 0 in the Restart screen event, then the following in the Player control event:
IF DEADLY BEEP 100 EXPLODE 8 LET L 1 ENDIF and the following in one of the two Main Loop events:
IF L > 0 ADD 1 TO L IF L > 42 KILL ENDIF ENDIF The screen will then restart and L put to 0 again.
Collision with LASERs is detected as COLLISION 10.
If you want to make the sprite explode only once per game, set a variable, say E as in your example, to 1 in the Game Initialization event. Then modify the Player control event as follows:
IF DEADLY IF E = 1 BEEP 100 EXPLODE 8 LET L 1 LET E 0 ENDIF ENDIF
|
|
|
Post by andrewvanbeck on Mar 30, 2017 9:17:44 GMT
I'm gonna have a guess... you resized the game window. I'm afraid its a bug - if you resize the game window then the particle specialisation stops working - lasers, trails, explosions. Its a real shame, but maybe you can make do with the initial window size instead, means starting over but AGD users have to be flexible
|
|
|
Post by alessandro on Mar 30, 2017 14:42:44 GMT
I'm gonna have a guess... you resized the game window. I'm afraid its a bug - if you resize the game window then the particle specialisation stops working - lasers, trails, explosions. Its a real shame, but maybe you can make do with the initial window size instead, means starting over but AGD users have to be flexible Not really Both Seto Taisho Vs Yokai and the title I am currently working on are specialized as "particle", do not use the initial window size, and lasers, trails and explosions work correctly. Tested on AGD 4.6 and 4.7. I tested the code examples above and they work as intended. The explosion counter idea in particular has already been implemented in Seto Taisho.
|
|
|
Post by andrewvanbeck on Mar 30, 2017 14:56:31 GMT
Which emulator are you using Alessandro - I've seen that particles bug in Spin, I'm starting to wonder if the emulator is causing more problems than AGD.
Should really start using Spectaculator again, but god knows where my purchase details are for that.
|
|
|
Post by alessandro on Mar 30, 2017 19:49:30 GMT
ZX Spin was a lovely emulator in its heyday, but Dunny has not updated it for ages and it's buggy as hell.
I am using Spectaculator most of the times, although for testing purposes SpecEmu is, as far as I know, the closest you can get to the real thing - and new software should be checked on real hardware before releasing it to the public anyway.
The only reason to keep using Spin nowadays is that, to my knowledge, it is the only emulator for Windows which allows you to record live tape save output through a WAV file, which is great for studying custom loader schemes when you only have the source code and no sample available.
For the license details I'd advise you to ask Jonathan Needle himself, you are a registered user after all and I am sure he will help you.
|
|
|
Post by highrise on Apr 8, 2017 13:23:18 GMT
hi guys
I discovered the exact detail of this particle bug which I reported in the bug section. Basically, if you set up a screen which includes the last column on the right, then particles won't work.
|
|