Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 02:17:52 *
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]   Go Down
  Print  
Author Topic: Grammer Sprite Editor - A simple sprite editor made in Grammer code  (Read 205 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 23:25:09
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3741


Topic starter
Total Post Ratings: +598

View Profile
« on: 18 November, 2011, 00:45:21 »
+2

I was requested earlier to make a new example program and was then suggested to make a sprite editor. So here we are Smiley

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
*Indents are here solely for viewability

.0:Return                ;The header
"USprite→A               ;Stores the string location to A (used for optimisation since the string is used several times)
Get(A                    ;Gets the location of the appvar named Sprite
If =0                    ;Zero is returned if the var does not exist
Then
  ClrDraw                  ;Clears the draw buffer (graph screen) and resets text coordinates
  Text(º"How many sprites? ;º means draw to the last text coordintate
  DispGraph                ;Displays the draw buffer
  expr(Input →N            ;Allows the user to input a string and expr( turns it to a number
  Text(6,0,"Width?         ;
  DispGraph                ;
  expr(Input →W            ;
  Text(12,0,"Height?       ;
  DispGraph                ;
  expr(Input →H            ;
  Send(4+N*W*H,A→Z         ;Creates the appvar :)
  int(Z,W                  ;Stores the Width to the first byte of the var
  int(Z+1,H                ;Stores the Height to the second byte of the var
  iPart(Z+2,N              ;Stores the Number of sprites (stores it as a 2-byte word)
End
Unarchive A
Get(A→Z                  ;
IS>(Z→W                  ;reads the byte at Z, then increme,nts Z
IS>(Z→H
{Z→N
Z+2→Z
ClrDraw
0→X →Y →B                ;X will be X pixel Coord, Y=Ypixel coord, B=sprite number
π87EC→θ                  ;This is the location of the clipboard (256 bytes)
Line(0,0,1+H,1+W*8,3     ;Draws the boundaries for the sprite
Repeat A=55              ;55 is the [mode] key
Z+B*W*H→V                ;Used multiple times, so why not store it to a var?
Pt-On(0,V,0,0,W,H        ;Draws the sprite
Repeat A=55 +getKey(10 +getKey(11
  pxl-Test(Y,X→C
  9→D
    Repeat A
    D+1
    If >9                    ;Checks if the previous result is >9. This is the timer for blinking
    Pxl-Change(Y,X 0         ;Changes the pixel state at Y,X and then returns 0 in Ans
    →D
    getKey→A
    End
  Pxl-Off(Y,X
  C
  If getKey(56           ;56=Delete
  0
  If getKey(9            ;9=Enter
  1
  If getKey(54           ;54=2nd
  !C
  If Ans
  Pxl-On(Y,X
  If A=15
  Line(0,0,H,W*8,0       ;Draws a white rectangle to erase the sprite data
  Y+H+getKey(1
  -getKey(4
  /H θ'→Y                ;θ' is the remainder from the division. This lets the cursor loop :)
  X+getKey(3
  -getKey(2
  +W*8 /W*8 θ'→X
End
Pt-On(4,Z+B*W*H,0,0,W,H   ;Swaps the sprite data from on screen to the sprite set (saves the changes)
B+N+getKey(10
-getKey(11
/N θ'→B
End
Stop
That is working code (without the clipboard).

The program here allows you to create a sprite set if appvar Sprite does not exist, it prompts for the number of sprites to include as well as their size. There is clipboard functionality as well as a kind of "Undo" for mistakes. Have fun?

Oh, also, I was also told to make it work with the map editor, so that should happen soon Evil But I have to go to work now...

Oh, and for those who plan to use the sprite sets, the offset into the appvar data is 4 to get to the sprite data (the first 4 bytes tell the number of sprites and size).

* GSPRTEDT.zip (11.22 KB - downloaded 9 times.)

* Sprite Editor Example 0.gif (67.35 KB, 192x128 - viewed 51 times.)
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!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Sorunome
Muffins
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 00:13:32
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2920


Total Post Ratings: +161

View Profile WWW
« Reply #1 on: 18 November, 2011, 16:49:55 »
0

Nice Program! O.o I might try it out! Smiley
Logged

http://z0r.de/4017
http://www.youtube.com/watch?v=BFOoazEx9lU
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

++++++[>++++++++++<-]>++++++++.<+++[>+++++++++++<-]>.+++++++++++++.--.<+++[>+++<-]>.<+++[>>++++++++++<<-]>>++.<<+++++++[>-------<-]>.<+++[>+++++++++++++<-]>..+++++++.<+++[>-----<-]>--.<++[>++++++<-]>++.

If OmnomIRC is screwed up, blame me Tongue

Save Derpy!(http://www.youtube.com/watch?v=cg-_HeVNYOk)
Spoiler for spoilers:


Spoiler for languages:
- TI-BASIC
 - TI-Highbrid Basic
 - Grammer
 - Axe
 - HTML
 - JavaScript
 - CSS
 - PHP
 - C++
 - lua
 - Python
 - MYSQL
 - Brainf*ck
 - English
 - German
Spoiler for internet:
/image/36691.png[/img]
Gimme internet NOW
Spoiler for me:
Spoiler for my little game:
my little game...my little game..aaaaaahhhhhh...my little game, i used to wonder how to lose the game, my little game, until you shared its losing with me. take the losing and the game, a beutiful game so losable, sharing losing is a easy sweat and losing makes it aweful neat to have my little game togeather with my very best games.
Spoiler for stuff:
Spoiler for derpy:



Pages: [1]   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.403 seconds with 30 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.