Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Munchor

Pages: 1 ... 11 12 [13] 14 15 ... 20
181
Axe / Axe Greyscale Tutorial
« on: February 20, 2011, 09:36:05 am »
Introduction
When I was new to Axe programming, I thought greyscale was reserved for extreme coders. I thought that making a greyscale game was really hard and I couldn't possibly do it. However, I noticed most games were greyscale and decided to try to make my first greyscale program. This is a quick guide and tutorial to help you with Axe greyscale.

The first think you need to know is that there are two types of greyscale in Axe. You can have three levels greyscale and four levels greyscale. The first one has three colours: Black, Grey and White. The second one has four colours: Black, Dark Grey, Light Grey and White.

Note: When I say white, I mean nothing, empty, the LCD colour.

We're starting off with three level greyscale since it is more simple and easy to understand.

I assume you've had previous experience in Axe programming, otherwise it will be difficult for you to understand the tutorial from now on.

The basics

Let's start by making your first greyscale program.

I'll post the code right here and then explain:

Code: [Select]
.GRS
[FFFFFFFFFFFFFFFF]->Pic1
5->Y
40->X
Repeat getKey(15)
Pt-On(X,Y,Pic1)r
Line(0,63,95,63
If Y<55
Y+1->Y
End
DispGraphr
ClrDrawr
End

This is what this program will create:



It's a simple program that has greyscale and a gravity engine. It's a small grey square falling until it reaches the black line.

How did I achieve this?

3 Level Greyscale
Most drawing commands in Axe have a similar command followed by an 'r'. This 'r' can be found in 2ND+APPS+3.

The calculator can be divided in two parts, the main buffer (or front buffer) and the back buffer. It's a bit like layers, the back buffer's images will be displayed behind the main buffer's images. The back buffer is also a way to draw greyscale images.

If you had already drawn images on Axe, you probably did something like this:

Pt-On(X,Y,Pic

This draws pictures in the front buffer. The next one draws them in the back buffer:

Pt-On(X,Y,Pic)r

To display mono (black and white) images, you'd use:

DispGraph

For greyscale images you use:

DispGraphr

This is very simple, but where's the greyscale?

Code: [Select]
-----           Black         Grey         White
Main Buffer      X                               
Back Buffer      X             X

If I draw something to the back buffer only it will be grey, if I don't draw nothing, it'll be white.

If I draw something in the main buffer, it will be black. If I draw something both in the main and the back buffer it'll be black too (example):

Code: [Select]
Pt-On(10,30,Pic1)r
Pt-On(10,30,Pic1

In three level greyscale, we always use DispGraphr to display images..


Now let's make a four level greyscale program.

4 Level Greyscale

Now that I've thought you the basics, four level greyscale is very easy to understand.

First of all, we use DispGraphrr to display images.

Now, how do we make black, light grey or dark grey images?

Code: [Select]
DispGraphrr:
Buffer        BackBuffer        Color

                              White
               X              Light Grey
X                             Dark Grey
X              X              Black

Here's an example of a black sprite, a light grey sprite and a dark grey sprite in order:

Code: [Select]
Pt-On(50,40,Pic1)r
Pt-On(50,40,Pic1

Pt-On(0,0,Pic2)r

Pt-On(0,40,Pic3

More Information

When you want to clear the back buffer, you also need to use the r:

ClrDrawr

Conclusion

I want to thank BuilderBoy who taught me greyscale originally (he doesn't know he did, but he did).

If you have any doubts, you can PM me or respond to the topic, someone or me will help you out.

Attachments

Attached is Zip File with the source and executable program we made here in the first place and the screenshot.

182
Site Feedback and Questions / Number of Downloads
« on: February 20, 2011, 06:41:30 am »
I was wondering if there is such statistic, at least it's not visible.

What I mean is, is there a way to view the top 10 users with more downloads (in post attachments)?

I know Quigibo would be far away from the second place but I'm curious about it.

183
GameInformer referenced Omnimaga due to Mrakoplaz'z nDoom.

The article can be found here.

Omnimaga is growing in popularity in regular gaming websites such as NeoGaf. That's right! This article was referenced in NeoGaf, one of the most important gaming forums on the Web! The thread can be found here.

We have to thank Mrakoplaz for making such an amazing game for the nSpire. I hope more members join our website and the activity spikes due to this piece of news.

184
Computer Programming / C/C++ Bad Habit
« on: February 18, 2011, 05:28:18 pm »
Hey guys,

I just had this doubt while learning C++:

Code: [Select]
#include <iostream>
#include <stdio.h> // C Library
#include <string>

using namespace std;

int fibonacci(int x)
{
if (x==0)
{
return 0;
}
else if (x==1)
{
return 1;
}
else
{
return fibonacci(x-1)+fibonacci(x-2);
}

}

void myfunc() //void functions have no 'return'
{
cout << "Hello multiple functions" << endl;
}

string dispString(string x)
{
return x;
}

int add(int a,int b)
{
return a+b;
}

int main ()
{
  cout << fibonacci(4) << endl; //Gets 4th number of fibonacci sequence
  myfunc(); //This executes myfunc()
  printf("Enter first number: ");
  int firstNumber;
  cin >> firstNumber;
  printf("Enter second number: ");
  int secondNumber;
  cin >> secondNumber;
  printf("%i",add(firstNumber,secondNumber)); //This returns the sum of the two input numbers before
  cout << dispString("\nWoah Woah\n"); // This prints dispString(string)
  printf("Hello World\n"); // 'Hello World' in C

  string s; //Declares string
  cout << "\nEnter your name: "; //Asks for name input
  cin >> s; //Gets input and stores it in variable s
  cout << "\nYour name is: " << s; //Displays variable s

  system("pause>nul"); // system("pause"); but without the text (null)
  return 0; //main returns 0
}

I started C++ half an hour ago and was wondering... Is using C in the middle of C++ a bad habit? Notice what I'm doing above.

Thanks.

185
Math and Science / 3 simple rule - something
« on: February 15, 2011, 04:15:04 pm »
In portuguese, we have something called 'Regra de 3 Simples', and I'd like to know what it is called in English:


1  -   4
2  -   x

x = (2*4)/1
x = 8

It's used in direct proportions, what's it called, do you have a name for it?

186
Miscellaneous / Valentine's Day
« on: February 14, 2011, 02:15:00 pm »
So, today's the 14th of February.

Did you do anything special, get anything special, or give anything special?

I didn't get, gave or did anything special, too bad, maybe next year :P

And to make this a real valentine's day topic:


187
Humour and Jokes / I failed at my math test. Why?
« on: February 13, 2011, 03:24:20 pm »
Hey guys, my teacher put a big '?' on this, any idea why?





Note: if you think it should be in randomness, move it.

188
Computer Projects and Ideas / mePlaysMedia
« on: February 13, 2011, 06:27:30 am »
I just created a media player for Windows users that can read several video and music files like .mp3, .wav, .wma, .wmv, .avi and many more.

Attached is the setup program that will install the program in your computer in a few seconds, hope you like it ;D

I didn't code the setup, I used a setup maker for that purpose.

189
Web Programming and Design / davidgom.co.cc Redesign
« on: February 11, 2011, 01:29:38 pm »
So, my website will go under extreme changes, such as new utilities, new design, new pages, so I decided to create a new topic for it. Here is a preview of the most likely outcome:





What do you think of it?

Do you have any ideas?

Thanks!

190
TI-BASIC / [TI-Basic] Divide Numbers and Rest of Division
« on: February 11, 2011, 11:17:27 am »
I have a TI-Basic doubt:

How to check if a number is divisible by another?

So, for example 9 is divisible by 3, but 10 isn't divisible by 3.

So, check if a number, when divided by another will return an integer.

Thanks.

191
Computer Programming / I give up, I need help with Python
« on: February 10, 2011, 04:05:52 pm »
Assemblex has been stuck because of the 8xp file maker...

Code: [Select]
def ExporTo8xp(event):
def to_binary(hex_string):
ints = [int(hex_string[i:i+2], 16) for i in range(0,len(hex_string),2)]
return struct.pack('B' * len(ints), *ints)

dlg = wx.FileDialog(self, "Choose a file", self.dirname, "", "8XP Files (*.8xp)|*.8xp", \
wx.SAVE | wx.OVERWRITE_PROMPT)

if dlg.ShowModal() == wx.ID_OK:

programData = self.inputText.GetValue()

self.filename=dlg.GetFilename()
self.dirname=dlg.GetDirectory()
filehandle=open(os.path.join(self.dirname, self.filename),'wb')


filehandle.write(to_binary(finalProgram))
filehandle.close()

self.SetTitle('Assemblex - '+self.filename)

dlg.Destroy()

This is the GUI code for it, the programData variable is the Hexadecimal code given by the user...

However, all I need to move on is to create a 8xp file:

Code: [Select]
programData = self.inputText.GetValue()
Code: [Select]
2A2A54493833462A
1A0A0046696C6520
67656E6572617465
6420627920576162
6269745369676E00
0000000000000000
000000000029000D
0018000650524F47
52414D0000001800
1600BB6DCE0B

This is a sample code of an assembly program, I need to change the size of the program. I can count the length of it, so let's say it is 98 bytes:
> How can I make 98 bytes, what is the size of the program in the hex code of it?


I know this is very general, I'll try to give you more details when I can.

192
Miscellaneous / [Solved] Happybojr's Ban - The After Ban
« on: February 09, 2011, 06:14:37 pm »
I was recently (a couple of minutes) contacted by happybojr, and so was DJ, it seems we are the two persons of Omnimaga he has the email address of.

It said....
Code: [Select]
Hello, this is happybobjr.

I am not sure why, and would love more information why i am banned from omnimaga.
Any information would be great.

And then I said...
Code: [Select]
Hello happybojr, I have to tell you that it seems you spammed.

Check http://netham45.org/irc/EfNet/view.php?log=omnimaga.20110209

Check that, 11:54 AM.

It was quite bad and DJ was quite pissed. However, I am almost sure it was not you.

And he said...
Code: [Select]
time?
And I replied...
Code: [Select]
11:54 AM.

Search inside the page 'GOD DAMNIT' and you will find it.

And he finally said...
Code: [Select]
Holy cow!
That was most certainly not me.

I think I know who it is and I am really sorry that this happened.
It looks like it happened during my lunch period today.


Could you send DJ my most sincere apologies that this happened and ask if he can unban me and give me a new password?


I think I should let everyone know of this since I always knew it couldn't have been him, he would never do such thing.

I am now going to tell him that DJ is not an admin any more but that soon an admin will know of this.

193
TI Z80 / Living Balls
« on: February 09, 2011, 04:47:58 pm »

My goal is to make a game for the TI-83+ series similar to that one.

Progress: 10%

Goals:
Highscore system; //You can see this is not in order
Physics sytem;
Getting harder as time goes; //This is what's getting tricky now.

Not sure if such thing was ever attempted for the calculator, but I'm trying, not very hard, though.

I don't have a screenshot for now but I'll try as soon as I can.

194
Math and Science / Imaginary Numbers Question
« on: February 09, 2011, 04:22:26 pm »
No, I'm not asking you to tell me how they work and general stuff.

But the other day my teacher said:

x²>0

And I thought... Hm, any number ² will be bigger than 0, since all squared numbers are positive. However, I just checked:

Code: [Select]
>>> 0**2
0
>>>

And it seems, 0² will be 0, so x²>=0.

What I want to know is if any imaginary number when squared will be minor than 0. Thanks.

195
ASM / Assemblex - Flash Application Hello World
« on: February 04, 2011, 10:50:24 am »
In order to try and test a new feature for Assemblex, I'd like to know how to create an application that displays HELLO WORLD.

I can do it in Axe easily, but I want the Assembly code. Also, can someone tell me a bit about header.asm/etc. files needed to code a flash application?

Pages: 1 ... 11 12 [13] 14 15 ... 20