5 Replies - 10906 Views - Last Post: 20 January 2011 - 02:47 PM Rate Topic: -----

#1 Freakzoyd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 20-October 10

How to make your own grid world actor?

Posted 20 October 2010 - 03:02 PM

Hello guys, maybe this was already asked or posted before but I'm new to the forums. I hope this is not considered as "doing my homework" because i really don't know how to do this and I don't have a good teacher. So, if anyone know how to make your own GridWorld Actor, I will apreciate if you share that knowledge with me. Thx.
Is This A Good Question/Topic? 0
  • +

Replies To: How to make your own grid world actor?

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10563
  • View blog
  • Posts: 39,087
  • Joined: 27-December 08

Re: How to make your own grid world actor?

Posted 20 October 2010 - 03:11 PM

You have to extend Actor. See the extends keyword.
class MyActor extends Actor{}



Now MyActor is-an Actor, but behaves in exactly the same way as the super class. To add custom behavior, you'll want to override the act() method MyActor inherits from Actor.

You may also want to check out the DIC Java tutorials section for tutorials on inheritance.
Was This Post Helpful? 0
  • +
  • -

#3 Freakzoyd  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 20-October 10

Re: How to make your own grid world actor?

Posted 20 October 2010 - 05:05 PM

View Postmacosxnerd101, on 20 October 2010 - 02:11 PM, said:

You have to extend Actor. See the extends keyword.
class MyActor extends Actor{}



Now MyActor is-an Actor, but behaves in exactly the same way as the super class. To add custom behavior, you'll want to override the act() method MyActor inherits from Actor.

You may also want to check out the DIC Java tutorials section for tutorials on inheritance.


Sorry I think i dind't express myself correctly, the real question is how to use any other picture instead of the Bug in GridWorld, like using spongebob or a pokemon instead of the bug.
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10563
  • View blog
  • Posts: 39,087
  • Joined: 27-December 08

Re: How to make your own grid world actor?

Posted 20 October 2010 - 05:09 PM

You need a 48x48 .GIF file with the same name as the class in the same folder as the .class file. So if you have the MyBug class, you need a 48x48 MyBug.gif file.
Was This Post Helpful? 0
  • +
  • -

#5 Ostralis  Icon User is offline

  • #include <greeter>
  • member icon

Reputation: 9
  • View blog
  • Posts: 559
  • Joined: 13-December 08

Re: How to make your own grid world actor?

Posted 10 November 2010 - 01:44 PM

I believe the image can be of larger size, but it would be scaled down to that size, if I'm correct. Either way, sounds like you've solved this.
Was This Post Helpful? 0
  • +
  • -

#6 hhickman2307  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 20-January 11

Re: How to make your own grid world actor?

Posted 20 January 2011 - 02:47 PM

View PostOstralis, on 10 November 2010 - 01:44 PM, said:

I believe the image can be of larger size, but it would be scaled down to that size, if I'm correct. Either way, sounds like you've solved this.


Yes you can use larger pictures, it scales them down
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1