Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 May, 2013, 23:14:21 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 3 4 [5] 6   Go Down
  Print  
Author Topic: Flames tutorial -  (Read 4354 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #60 on: 28 January, 2012, 14:20:27 »
0

That's surely a great tutorial, but I haven't really understood how to burn only one sprite, in a big screen with several others Huh?
« Last Edit: 28 January, 2012, 14:24:46 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 21:46:19
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3740


Total Post Ratings: +598

View Profile
« Reply #61 on: 28 January, 2012, 14:42:26 »
0

That is tough and it depends... Pretty much, as builder said, the basics are this:
-you shift the pixels up one
-you give it a chance to disappear (For example, 1/8 chance)

Depending on the sprite situation, you will probably have to use 2 For( loops to check each pixel of the sprite as well as giving it an upper limit (like the flames can only go as high as another 8 pixels)
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #62 on: 28 January, 2012, 15:47:32 »
0

Right now, I have a sprite moved by the player, and an inanimated block which I want him to burn. How must I do it ?
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 21:46:19
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3740


Total Post Ratings: +598

View Profile
« Reply #63 on: 28 January, 2012, 17:09:23 »
0

okay, I am not sure if this will work as I am not much of an Axe coder, but maybe try this?

1
2
3
4
5
6
7
8
9
10

For(B,X,X+7
For(C,Y+1,Y+15
pxl-Test(C,B→A
pxl-Off(C-1,B
If rand^8
pxl-On(C-1,B
End
End
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #64 on: 28 January, 2012, 17:12:50 »
0

pxl-Test returns 0 if the pixel tested is off or 1 if it's on o_O what do you do with this command ?
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 21:46:19
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3740


Total Post Ratings: +598

View Profile
« Reply #65 on: 28 January, 2012, 17:14:27 »
0

Oops, let me modify that Big smile:

1
2
3
4
5
6
7
8
9

For(B,X,X+7
For(C,Y+1,Y+15
pxl-Off(C-1,B
If rand^8*pxl-Test(C,B
pxl-On(C-1,B
End
End
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #66 on: 28 January, 2012, 17:19:28 »
0

It doesn't work Undecided

Here it is the full code I use :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
44->X-16->Y

Repeat getkey(15)
 Pt-On(X,Y,[FFFFFFFFFFFFFFFF
 For(B,X,X+7)
  For(C,Y+1,Y+15)
   Pxl-Off(C-1,B
   If rand^8*pxl-Test(C,B)
    Pxl-On(C-1,B
   End
  End
 End
 DispGraph
End
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
MGOS
LV5 Advanced (Next: 300)
*****
Online Online

Gender: Male
Last Login: Today at 23:04:39
Date Registered: 29 July, 2011, 16:54:53
Location: Germany
Posts: 295


Total Post Ratings: +73

View Profile
« Reply #67 on: 28 January, 2012, 17:26:11 »
0

It burns the pixels below the block. You'd have to do this:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
44->X-16->Y

Repeat getkey(15)
 Pt-On(X,Y,[FFFFFFFFFFFFFFFF
 For(B,X,X+7)
  For(C,Y-7,Y+7)  //I changed this line
   Pxl-Off(C-1,B
   If rand^8*pxl-Test(C,B)
    Pxl-On(C-1,B
   End
  End
 End
 DispGraph
End

No guarantee, but I hope it works.
« Last Edit: 28 January, 2012, 17:26:37 by MGOS » Logged

Click those to see more information Smiley
Current   
Projects: 
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #68 on: 28 January, 2012, 17:32:37 »
0

it doesn't work anymore >_< but I don't know why, it seems that it would be ok o_O

EDIT : I just found what's wrong :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
44->X-16->Y

Repeat getkey(15)
 Pt-On(X,Y,[FFFFFFFFFFFFFFFF
 For(B,X,X+7)
  For(C,Y-7,Y+7)  //I changed this line
   Pxl-Off(B,C-1     <----------------------- Here
   If rand^8*pxl-Test(B,C) <---------------- Here
    Pxl-On(B,C-1    <------------------------ and Here
   End
  End
 End
 DispGraph
End

That's why instead of Grammer, the Axe commands Pxl-xxx give the X as first argument and Y as second xD
« Last Edit: 28 January, 2012, 17:41:47 by Matrefeytontias » Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
MGOS
LV5 Advanced (Next: 300)
*****
Online Online

Gender: Male
Last Login: Today at 23:04:39
Date Registered: 29 July, 2011, 16:54:53
Location: Germany
Posts: 295


Total Post Ratings: +73

View Profile
« Reply #69 on: 28 January, 2012, 17:45:48 »
0

Yeah, ninja'd again.
Logged

Click those to see more information Smiley
Current   
Projects: 
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #70 on: 28 January, 2012, 17:46:58 »
0

But, I've had the time to put a +1 at your message Big smile
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 21:46:19
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3740


Total Post Ratings: +598

View Profile
« Reply #71 on: 28 January, 2012, 19:06:50 »
+1

So did my code work, otherwise?
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #72 on: 28 January, 2012, 19:13:34 »
0

Yes, that's a great code, thanks Grin and you can make the flame longer by changing the second For loop (and I found that rand^6 is better than rand^8)
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
MGOS
LV5 Advanced (Next: 300)
*****
Online Online

Gender: Male
Last Login: Today at 23:04:39
Date Registered: 29 July, 2011, 16:54:53
Location: Germany
Posts: 295


Total Post Ratings: +73

View Profile
« Reply #73 on: 28 January, 2012, 19:48:32 »
0

Yes, that's a great code, thanks Grin and you can make the flame longer by changing the second For loop (and I found that rand^6 is better than rand^8)

The number you subtract in the for loop is the height of the flames -1.
This would make the flames 16 pixels high

1
For(C,Y-15,Y+7)

Changing the modulus at the rand will change the density of the flames. A high number like 8 or 10 will let the flames have more particles than having a small number like 4 or 6.


1
2
3
4
If rand^10*pxl-Test(B,C)  //High density = more particles
...
If rand^4*pxl-Test(B,C)  //Low density = less particles
Logged

Click those to see more information Smiley
Current   
Projects: 
Matrefeytontias
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: Today at 17:02:18
Date Registered: 14 October, 2011, 18:48:49
Location: Alone in the Park
Posts: 854


Total Post Ratings: +174

View Profile
« Reply #74 on: 28 January, 2012, 20:28:21 »
0

Yeah, that's it
Logged

/\   ><   [-   |_|   _\~   [-   /?



Spoiler for Shameful self-advertising:
/image/37571.png[/img]
If at a certain moment you think that I'm awesome, give an internet (>^_^)>
Pages: 1 ... 3 4 [5] 6   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.386 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.