Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / explosions , how ?

Author
Message
haliop_New
User Banned
Posted: 25th Nov 2014 09:04 Edited at: 28th Nov 2014 09:58
thinking trough how i want to achive an explosion i got nothing spent about a week trying to think it trough came out with 0

have anyone tried to create explosions ? or have any ideas how to achive it
im not going to use the particle system since the lack of physics attached to it , so i want to create something with alot of sprites and physics so it wont overlap physics boxes that are around the map.. and add abit of smoke that going up to it.. any ideas ?


Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 25th Nov 2014 09:40
What sort of explosion ?

A simple sprite of an explosion could work, for example if your use :
SetSpriteAngle(sprite, random(0,360))

You can add some jitter/scatter value with :

s# = random(5,15)*0.1
SetSpriteScale(sprite,s#,s#)


I use it on my game Fight Fortress, and it works fine. But it depend on the explosion you want.

http://www.dracaena-studio.com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Nov 2014 09:56 Edited at: 25th Nov 2014 09:56
I tend to build my own particle systems so that I can make particles behave how I want. It's the best way really. You could use an explosion spritesheet like the ones that came with this issue of the newsletter and just add some extra particle effects for smoke etc.

Example of spritesheet below. Using a transparency setting of 2 you can use these spritesheets with additive blending which looks great for explosions:

Attachments

Login to view attachments
haliop_New
User Banned
Posted: 25th Nov 2014 10:07
thank you
bax how do i use spritesheets ? never done it before
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 25th Nov 2014 10:18 Edited at: 25th Nov 2014 10:19
@Haliop : load an image, create a sprite, then use SetSpriteAnimation()



You have some examples in the doc (sprite/animation).
You can play it, pause it, resume it, change the speed, change the frame current...

http://www.dracaena-studio.com
haliop_New
User Banned
Posted: 25th Nov 2014 10:32
wow ok didnt know i have this explained in the tuts.
ok i'll try it see what happens.
thank you as always.

if you have another ideas for explosions please share.
haliop_New
User Banned
Posted: 25th Nov 2014 10:45
for some reason i get a black square instead of the explosions

i did this

expImg = LoadImage(expl01.png)
a = CreateSprite(expImg)
SetSpriteAnimation(a,768/30,640/30,30)
playSprite(a)

is this wrong ?
ApkGames.Guru
11
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 25th Nov 2014 11:02
There are many ways to achieve this and it's definitely down to personal preference.

A method I used at times is an array, which means I can set off multiple explosions at the same time and all will run independently until their size condition is met, then it's deleted to make way for another explosion.

This takes only one image of an explosion and two functions, one which is called with the X, Y to establish the explosion and another which progresses it through it's scale until it's big and I want to remove it.

The code snippet here allows for 50 explosions at once.

You just need a 'explosion.png' image in your media folder around 200x200 in size, a mature explosion, as the function will start it at a low scale, which gives you the impression it's exploding when the scale increases.

Cheers, Ian.



www.zortokgames.com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 25th Nov 2014 11:37
haliop_New, try changing it to this:
haliop_New
User Banned
Posted: 25th Nov 2014 17:33
thank you got it working . looks pretty damn good.
haliop_New
User Banned
Posted: 26th Nov 2014 20:35
so you must be wondering what i did with the explosion right ?


here you go

easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 26th Nov 2014 23:48
That's pretty coool


Audacia Games - Latest WIP - AUTOMAYTE 2.1, AppGameKit one click deploy to Android
"When you've finished 90% of your game, you only have 90% left"
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 27th Nov 2014 00:05
That looks so cool! I want to play it!

Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 27th Nov 2014 02:15
haliop_New
User Banned
Posted: 27th Nov 2014 07:42
thanks :d

cant play it yet , the game is no where near done.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 27th Nov 2014 08:38
@haliop_new : it's great !
Are you using the physique and particle on your explosion ? How much spritesheet or particle system do you use for this kind of explosion ?

http://www.dracaena-studio.com
haliop_New
User Banned
Posted: 27th Nov 2014 09:18
i dont use the particles system ive built a simple solution with physics.

there is one spritesheet for the explosion animation

then there is one smoke unit that implants smoke sprites every 0 or more milliseconds, this smokes units goes up to the sky , rotating , chaning alpha, changing colors and size , so when the alpha is below 10 it deletes it.

and there are 4 more smoke trails that acts just the like smoke unit above only with a bit of diffrence using physics impulse it sends them away.

and there is one shock wave sprite that gets bigger with time and deleted when it gets to a certain size , that gives me thiking that i need to change the alpha on the shock wave make it dissapear smoother
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 27th Nov 2014 09:43
thank you for information, it's interesting

http://www.dracaena-studio.com

Login to post a reply

Server time is: 2024-11-25 11:15:48
Your offset time is: 2024-11-25 11:15:48