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 ... 87 88 [89] 90 91 ... 424
1321
« on: May 27, 2011, 11:09:07 am »
1322
« on: May 27, 2011, 10:44:37 am »
Here's a WTF video for you guys
1323
« on: May 27, 2011, 09:38:56 am »
Woo! Thanks a lot calc84maniac and Runer112 I had to divide by 256 since it was in x256 mode.
1324
« on: May 27, 2011, 09:29:42 am »
Is this the last level btw ?
1325
« on: May 27, 2011, 09:29:19 am »
The context is:
24→C 24→E Repeat getKey(15) If (X-C+4<=8) and (Y-E+4<=8) Return End
.MORE COLLISIONS
.GETKEYS FOR THE MAIN SPRITE
.DRAW FLAG Pt-On(C,E,Pic1)
.THE MAIN SPRITE Rect(X/256,Y/256,4,4)
.DISPLAY IT ALL DispGraph End
So the main sprite moves with the keys, I want it when I touch the Pic1 (at coordinates (C,E)) the program closes.
1326
« on: May 27, 2011, 09:25:52 am »
I change variables inside loops quite often. In Axe, I don't know, but I do that a lot in pretty much every language.
1327
« on: May 27, 2011, 09:20:39 am »
That's the kind of crap you get when you pirate.
So this only happens in pirated versions?
1328
« on: May 27, 2011, 09:16:50 am »
I didn't get it I have a sprite at the coordinates (C,E). That sprite is still. I have a sprite that moves and I need to check if the moving sprite touches the other sprite, the moving sprite's coordinates are (X,Y). I tried this: If (X-C+4<=8) and (Y-E+4<=8) Return End
It didn't work though
1329
« on: May 27, 2011, 02:54:18 am »
And here's touching:
If (X-Z+4≤8) and (Y-θ+4≤8) .Sprites are touching End
I'm interested in this code, what would the variables mean? Only one of the object moves (coordinates X and Y) and the other object is stopped (C for it's x position, E for it's y position), but this is in my code. I guess X=X, Y=Y and Z=E and θ=C? Thanks
1330
« on: May 27, 2011, 02:51:05 am »
I wish you health DJ And good luck to the other admins too who now have less a collaborator.
1331
« on: May 26, 2011, 04:59:40 pm »
I have a 4*4 sprite (no tilemapping, just a sprite).
I have another sprite, 4*4.
I know the X and Y coordinates of both.
How to know if the latter sprite is touching the first one? Is it a too long code?
1332
« on: May 26, 2011, 04:10:18 pm »
It's bad to hear another admin has been demoted, even if temporarily. Will we know the reason for such demotion? Please note that he was a Coder of Tomorrow, and not an admin/manager.
Oh I knew that, but used the wrong word, sorry
1333
« on: May 26, 2011, 03:57:07 pm »
I like the new version, the old version doesn't even work for me.
But this one doesn't work for anyone
1334
« on: May 26, 2011, 03:52:23 pm »
KeyEvents.java
import java.awt.event.KeyEvent; import java.awt.event.KeyListener;
import javax.swing.JPanel;
import java.awt.Graphics;
public class KeyEvents extends JPanel implements KeyListener { GamePanel myGamePanel = new GamePanel(); @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == 39) //Right key { myGamePanel.x += 5; } }
@Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub }
@Override public void keyTyped(KeyEvent e) { // TODO Auto-generated method stub } } Squared.java
import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics;
public class Squared { public static void main(String[] args) { Squared mySquared = new Squared(); mySquared.createAndShowGUI(); }
public void createAndShowGUI() { JFrame f = new JFrame("Squared"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(480,320); f.setResizable(false); f.add(new GamePanel()); KeyEvents myKeyEvents = new KeyEvents(); f.addKeyListener(myKeyEvents); f.setVisible(true); } }
class GamePanel extends JPanel { int x = 5; int y = 5; public GamePanel() { }
public Dimension getPreferredSize() { return new Dimension(250,200); }
public void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.black); g.fillRect(x,y,40,40); } } I just did that (thanks for the tip) but the sprite still doesn't move right. How to repaint in the KeyPressed function? Thanks
1335
« on: May 26, 2011, 02:43:25 pm »
I really am in need of changing my avatar, any suggestions?
Pages: 1 ... 87 88 [89] 90 91 ... 424
|