# My Newest and Biggest project

**URL:** https://discourse.processing.org/t/my-newest-and-biggest-project/2763
**Category:** Project Guidance
**Created:** [August 18, 2018, 9:39pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763 "2018-08-18T21:39:10Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![JuniorGenius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/juniorgenius/32/1163_2.png) [@JuniorGenius](https://discourse.processing.org/u/JuniorGenius)
#### Post date: [August 18, 2018, 9:39pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/1 "2018-08-18T21:39:10Z")

</div>

so I am working on a big project called “Dump truck SImulator”. If you have played a simulator game on Roblox, then you know what this will be like. I **Just** started on it today and would like some help, but I won’t ask for direct code, just Ideas with examples on how to put them in.  
here it is so far:  
Truck: ``

> class Truck {  
> //positioning  
> int x, y;  
> //wether the hopper is up  
> boolean hopperUp;  
> //move the truck  
> void move() {  
> if (keyPressed) {  
> switch(key) {  
> case ‘a’:  
> x–;  
> break;  
> case ‘d’:  
> x++;  
> break;  
> }  
> }  
> }  
> //show the truck  
> void show() {  
> //wheels  
> //back  
> ellipse(x-12.5, y+25, 25, 25);  
> //front  
> ellipse(x+12.5, y+25, 25, 25);  
> }  
> }

---

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [August 19, 2018, 3:28am UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/2 "2018-08-19T03:28:38Z")

</div>

First step: Learn how to post code on the forums! Edit your post, select your code, and hit the MAGIC CODE FORMATTING BUTTON, which looks like this: \</\>

---

<div class="post-metadata">

### Author: ![JuniorGenius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/juniorgenius/32/1163_2.png) [@JuniorGenius](https://discourse.processing.org/u/JuniorGenius)
#### Post date: [August 19, 2018, 4:27pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/3 "2018-08-19T16:27:28Z")

</div>

thank you for telling me that, but I just tried it and it doesn’t work. Am I doing something Wrong?

---

<div class="post-metadata">

### Author: ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)
#### Post date: [August 19, 2018, 5:51pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/4 "2018-08-19T17:51:39Z")

</div>

### _Please format your code_ 😊

It consist on these two steps:

1. In your code editor (PDE, VS code, Eclipse, etc) ensure you execute the beautifier function. This function automatically indents your code. Auto-indenting makes your code easier to read and helps catching bugs due to mismatch parenthesis, for instance. In the PDE, you use the key combination: `ctrl+t`
2. You copy and paste your code in the forum. Then you select the code and you hit the formatting button aka. the button with this symbol: `</>`

That’s it! Please notice you do not create a new post in case you need to format something you already posted. You can edit your post, copy the code to the PDE, indent the code properly there and then past it back here, format the code and \>\> **save** \<\< the edits.

## Extra info:

Formatting your code makes everybody’s life easier, your code looks much better plus it ensures your code integrity is not affected by the forum’s formatting (Do you know the forum processes markup code?) Please visit the sticky posts or the FAQ section/post to learn about this, other advantages and super powers you can get in this brand new forum.

Kf

---

<div class="post-metadata">

### Author: ![JuniorGenius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/juniorgenius/32/1163_2.png) [@JuniorGenius](https://discourse.processing.org/u/JuniorGenius)
#### Post date: [August 19, 2018, 6:42pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/5 "2018-08-19T18:42:29Z")

</div>

That helps a lot 😄. thanks!

---

<div class="post-metadata">

### Author: ![EnhancedLoop7](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/enhancedloop7/32/1040_2.png) [@EnhancedLoop7](https://discourse.processing.org/u/EnhancedLoop7)
#### Post date: [August 19, 2018, 7:27pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/6 "2018-08-19T19:27:06Z")

</div>

That sounds like a great project 😃

So, if I were you, I would first consider a lot of OOP, that being Object Oriented Programming. I would learn about classes, and managing objects, and all that.

I would also see how the different objects in my game would relate to each other. In terms of a map, I am assuming yours will be 3D, so I would get to looking maybe at a library such as P3D or another one that manages 3D objects?

I would also think about how I would make my map. Honestly, I have not made many games that include maps, but I do know that to do that I have seen two dimensional arrays used. And it would be something like this (I do not know if this specific approach is what you would do for a 3D game, but this is what you would do for a 2D one) :

```auto
int[][] gameMap = { 
{ 1,0,1,2,3,1,1},
{ 1,3,1,2,3,1,1},
{ 0,0,0,0,1,2,1},
{ 0,1,2,1,2,3,2},
};

```

And like, a 0 would map out to be a grass part, and a 1 is like water, 0 is a tree, and so on and so forth. You can build a whole map that way, if you would like to. And obviously, you would have a function to handle that and appropriately display what you want on the screen when you want.

So I see in the code that you posted, that you drew your truck, and while you are at it, I would also think about checking for collisions with other objects and such.

As of now, that is what comes to mind at first. I would also draw out my planned finished result and all, just so I know what I’m working towards. If you have any more questions I would love to do my best to help answer that, and hopefully all goes well with that project 😂

EnhancedLoop7

---

<div class="post-metadata">

### Author: ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)
#### Post date: [August 19, 2018, 7:35pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/7 "2018-08-19T19:35:26Z")

</div>

Hey,  
I don’t know how you formatted you code but it should look like this:

```auto
class Truck { 
  //positioning 
  int x, y; 

  //wether the hopper is up 
  boolean hopperUp; 

  //move the truck 
  void move() { 
    if (keyPressed) { 
      switch(key) { 
      case 'a': 
        x--; 
        break; 
      case 'd': 
        x++; 
        break;
      }
    }
  } 
  //show the truck 
  void show() { 
    //wheels 
    //back 
    ellipse(x-12.5, y+25, 25, 25); 
    //front 
    ellipse(x+12.5, y+25, 25, 25);
  }
}

```

There are not so much we can do to help you right now but my advice you be divide to conquer! Start small and keep building on top of that. When you try to approach a new complicated part, code a sketch aside to get the concept done and then integrate it to your code.

Looking forward to see a first version 🙂

---

<div class="post-metadata">

### Author: ![JuniorGenius](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/juniorgenius/32/1163_2.png) [@JuniorGenius](https://discourse.processing.org/u/JuniorGenius)
#### Post date: [September 9, 2018, 11:43pm UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/8 "2018-09-09T23:43:58Z")

</div>

How do I make that function to read the Array? I’ve tried for about _15 days_ without luck and haven’t found any way to. May I have a coded **example** on how to do that?

---

<div class="post-metadata">

### Author: ![EnhancedLoop7](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/enhancedloop7/32/1040_2.png) [@EnhancedLoop7](https://discourse.processing.org/u/EnhancedLoop7)
#### Post date: [September 10, 2018, 1:29am UTC](https://discourse.processing.org/t/my-newest-and-biggest-project/2763/9 "2018-09-10T01:29:07Z")

</div>

You mean to read a two dimensional array? Can you please post what you’ve tried?

EnhancedLoop7
