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.


Messages - Munchor

Pages: 1 ... 19 20 [21] 22 23 ... 424
301
Calculator C / Re: Problem with C code
« on: September 07, 2011, 04:55:00 pm »
By the way, you used "++w", shouldn't it be "w++"? I've seen both being used but I can't understand the different.

EDIT: Oh wait, I got it (http://www.gamedev.net/topic/337133-i-vs-i/)

302
Computer Projects and Ideas / Re: Java - Falling Blocks
« on: September 07, 2011, 04:37:04 am »
Oh yeah, you're right.
It works now ^^
Nice game, btw

Thanks a lot!

303
Computer Projects and Ideas / Re: Java - Falling Blocks
« on: September 06, 2011, 05:07:55 pm »
You capitalized it incorrectly ;) Use "FallingBlocks" instead of "Fallingblocks" and try again. :)

Calcdude is right, use "FallingBlocks" ;) And this game is Java 6 by the way.

304
Computer Projects and Ideas / Re: Java - Falling Blocks
« on: September 06, 2011, 03:17:14 pm »
I can't open it ???
I did [Windows+R]>cmd>java FallingBlocks
but FallingBlocks.class is not found..

Edit: I tried with the java Runtime, but the window opens, and closes immediately

You have to go to the directory of the download.

1. Unzip the attachment somewhere
2. Open the cmd
3. cd to that directory.
4. java FallingBlocks

If it doesn't work, please tell me the error it gives. Thanks!

305
Computer Projects and Ideas / Re: Water Works
« on: September 06, 2011, 07:41:48 am »
I just finished Water Works, lots of rockets booming now yay!

I started yesterday, what an amazing game!

306
Miscellaneous / Collision in Games
« on: September 06, 2011, 05:45:46 am »
The very first games I coded were made in Axe, so I got used to doing pixel-level-perfect collision, because it was the best way for it. However, as I want to start developing games on larger scales, I need some help understanding how collision is done on engines that have objects moving at speeds faster than one pixel at a time.

For example, the attached video is a program of mine own, made in Python. It's a simple physics engine, but the block never has a speed bigger than one pixel, and I am using Fixed Point (x256) to get more precision.

I know, though, that on larger games objects need to move faster, but collision still works pretty well.

Code: [Select]
X = X + HORIZONTAL_ACCELERATION;
Y = Y + VERTICAL_ACCELERATION;

Basically, what I thought was. Instead of doing the code above, do:

Code: [Select]
While i < HORIZONTAL_ACCELERATION
  Check_Collision();
  X++
End

So, I thought I could add a bit of acceleration at a time, and check for collision all the time. However, I'm not sure if this is a very good idea, because I can't do X++. Sometimes, acceleration is negative.

I'm wondering if any of you has any idea of how collision is done on games, thanks!

307
Web Programming and Design / Re: Shiny new OmniPlayer
« on: September 06, 2011, 05:08:40 am »
UPDATE

-Added Shuffle feature
-Song title at the top no longer says undefined when it can't find the ID3 tags

Great, shuffle!

308
Feel free to copy my tutorials all you want, just make sure to credit me.

That makes two of us.

309
Computer Projects and Ideas / Java - Falling Blocks
« on: September 05, 2011, 05:20:04 pm »
I decided to port the Falling Blocks game I made for the TI Nspire Game Contest to computers, and I made it in Java, with a screen of 852*600. The graphics are as simple as the ones of the original game. It's almost an exact port, I wanted to keep it fast and simple, like the original.

Here's a couple of screenshots of it running. Oh and it's open-source, the source is included.


Blocks falling in the title screen


"Deathly" blocks are read, and the other are green

On the attached zip, "FallingBlocks.class" is the main class, so to run it, just do java FallingBlocks, or open FallingBlocks.class using the Java Runtime program, if you prefer to do it with the mouse.

310
Miscellaneous / Re: Types of Cell Phones
« on: September 05, 2011, 04:11:11 pm »
I do not have a cellphone, but if I was to get one, it might be android. After all, I already have an iPod Touch. Not sure if I want a cellphone yet, though, because I do not call/receive calls often and the plans are still quite expensive, although being able to go online from elsewhere is definively cool, especially if I got a 1 hour bus ride. :P

It's quite surprising that in the modern society someone like you doesn't have a cell phone, but I guess that if you don't need it, it's ok. But can't you go to the Internet on the iPod Touch?

311
Miscellaneous / Re: Types of Cell Phones
« on: September 05, 2011, 04:07:16 pm »
Oh wow... I pressed back then next again and it let me install it... Thanks ephan! And thanks again for the congrats lol

Yeah I knew there was something like that :D And be warned, the time I used the Android SDK on Windows, the emulator was so slow, I hope it's not like that for you.

312
Miscellaneous / Re: Types of Cell Phones
« on: September 05, 2011, 03:07:13 pm »
No budget lol. I had Tracfone, but as of two days ago I have Verizon. The HTC Droid Incredible 2 (which I'm using to type this) was USD$200 but my mom works at a hospital so I got 25% off.

EDIT: Er, no budget anymore lol. Now I just need to get the Android SDK to realize I have the JDK installed... Grr...

You also need it to be in the path, but I remember that on Windows, there was a secret thing to make it work on the setup, you had to go previous and then next or something.

On Linux it worked perfectly for me :) Installing programs on Windows is too hard.

Either way, congrats on your new acquisition!

313
Miscellaneous / Re: Gaming at school
« on: September 05, 2011, 08:23:15 am »
I always use the most basic tools for web development, sometimes I even use nano to edit my files.

nano is just a text editor, like Notepad++ (I don't understand the "even"). Either way, I think a tabbed text editor is the best thing for Web Development and Programming, I end up using vim a lot for it.

I find HTML very easy.  I use microsoft word if using windows.  And Abiword if using Linux.

Microsoft Office Word to develop HTML? I hope it works for you, but it doesn't make much sense IMO, it doesn't have syntax highlighting and it's CPU Consuming, unlike, MS Notepad or Notepad++. And you also have to pay for it, unlike what happens with Notepad++ or vim, or nano or most text editors.

Either way, aren't we get off-topic here?

314
Computer Programming / Re: [Java] Timer inside event-based class
« on: September 05, 2011, 05:28:14 am »
You're creating a new object (a thread) inside your class and calling one of its methods.  I'm pretty sure you can't do that, you can only have code there to initialize variables.  You can instead do "Thread myThread = new Thread(..);" and then in your constructor do "myThread.start();"  Or just move it all to the constructor since you don't need the object after that.

Thanks, it makes sense, but I can do the same thing, but using a Timer as nemo said.

I figured it out, and now I have a main game loop, thanks a lot!

315
Computer Programming / Re: [Java] Timer inside event-based class
« on: September 04, 2011, 04:56:27 pm »
Code: [Select]
import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.Timer;

import java.awt.event.*;

public class Game extends JPanel {
    JFrame mainFrame = new JFrame("Game");

    String[] full_map = {"0101010101",
     "1010101010",
     "0101010101",
     "1010101010",
     "0101010101",
     "1010101010",
     "0101010101",
         "1010101010",
                         "0101010101",
              "1010101010"};

  new Thread(new Runnable() {
    long prevTime = System.currentTimeMillis();
public void run() {
      if (System.currentTimeMillis() >= prevTime+1000*2) {
    prevTime = System.currentTimeMillis();
    System.out.println("hello");
  }
    }
  }).start();

  public void paintComponent(Graphics g) {
    /* Draws the elements on the screen */
    super.paintComponent(g);

    int y, x;
    for (y = 0; y < this.full_map.length; y++) {
      for (x = 0; x < this.full_map[y].length(); x++) {
        if (this.full_map[y].charAt(x) == '1') {
          g.setColor(Color.BLACK);
          g.fillRect(50*x, 50*y, 50, 50);
        }
      }
    }
  }

  public Game() {
    /* Defines the frame and the game panel */
    this.setFocusable(true);
    mainFrame.setSize(this.full_map[0].length()*50, this.full_map.length*50);
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.getContentPane().add(this);
  }

  public void start() {
    /* Displays the frame, start the game */
    mainFrame.setVisible(true);
    this.requestFocus();
  }
}

This is my whole code,

Quote
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
   Syntax error on token ";", { expected after this token
   Syntax error on token "}", delete this token

   at Game.<init>(Game.java:22)

The Java compiler returned that. I'm not sure of what's wrong, seems like not matching braces, but it all looks correct.

Pages: 1 ... 19 20 [21] 22 23 ... 424