This site requires JavaScript, please enable it in your browser!
Greenfoot back
sashvanth
sashvanth wrote ...

2021/12/15

Greenfoot.playSound("FUEL.mp3"); not working

1
2
danpost danpost

2021/12/17

#
sashvanth wrote...
do you mean this << Code Omitted >>
I see addObject there; but no new Fuel(). Maybe you should just show all the code in that class (select all and paste here).
sashvanth sashvanth

2021/12/18

#
public Track() { // Create a new world with 600x400 cells with a cell size of 1x1 pixels. super(2000,1800, 1); prepare(); } /** * Prepare the world for the start of the program. That is: create the initial * objects and add them to the world. */ private void prepare() { BALL ball = new BALL(); addObject(ball, 68, 38); BALL ball2 = new BALL(); addObject(ball2, 103, 47); removeObject(ball2); BALL ball3 = new BALL(); addObject(ball3, 75, 68); ball3.setLocation(67, 59); BALL ball4 = new BALL(); addObject(ball4, 71, 86); ball4.setLocation(66, 78); Car2 car2 = new Car2(); addObject(car2, 248, 109); Car1 car1 = new Car1(); addObject(car1, 105, 192); Car3 car3 = new Car3(); addObject(car3, 368, 425); Aeroplane aeroplane = new Aeroplane(); addObject(aeroplane, 623, 170); Ambulance ambulance = new Ambulance(); addObject(ambulance, 498, 587); SCRT scrt = new SCRT(); addObject(scrt, 1920, 1701); Dot dot = new Dot(); addObject(dot, 1460, 361); Dot dot2 = new Dot(); addObject(dot2, 1411, 568); Dot dot3 = new Dot(); addObject(dot3, 425, 437); Dot dot4 = new Dot(); addObject(dot4, 261, 244); Dot dot5 = new Dot(); addObject(dot5, 986, 111); Dot dot6 = new Dot(); addObject(dot6, 1360, 659); Dot dot7 = new Dot(); addObject(dot7, 877, 452); Dot dot8 = new Dot(); addObject(dot8, 308, 762); Dot dot9 = new Dot(); addObject(dot9, 1209, 205); Dot dot10 = new Dot(); addObject(dot10, 1768, 438); Dot dot11 = new Dot(); addObject(dot11, 1569, 647); Dot dot12 = new Dot(); addObject(dot12, 1710, 80); Dot dot13 = new Dot(); addObject(dot13, 1609, 129); Car2 car22 = new Car2(); addObject(car22, 1694, 176); Car2 car23 = new Car2(); addObject(car23, 458, 439); car23.setLocation(447, 428); car23.setLocation(442, 436); car23.setLocation(446, 435); car23.setLocation(711, 356); Car2 car24 = new Car2(); addObject(car24, 824, 178); Car2 car25 = new Car2(); addObject(car25, 1416, 746); Car1 car12 = new Car1(); addObject(car12, 916, 446); Car1 car13 = new Car1(); addObject(car13, 1755, 455); Dot dot14 = new Dot(); addObject(dot14, 1064, 822); Dot dot15 = new Dot(); addObject(dot15, 1177, 912); Dot dot16 = new Dot(); addObject(dot16, 1704, 1071); Dot dot17 = new Dot(); addObject(dot17, 1661, 871); Dot dot18 = new Dot(); addObject(dot18, 1405, 850); Dot dot19 = new Dot(); addObject(dot19, 576, 978); Dot dot20 = new Dot(); addObject(dot20, 972, 896); Dot dot21 = new Dot(); addObject(dot21, 1362, 1243); Dot dot22 = new Dot(); addObject(dot22, 1517, 991); Dot dot23 = new Dot(); addObject(dot23, 711, 760); Dot dot24 = new Dot(); addObject(dot24, 1271, 1539); Dot dot25 = new Dot(); addObject(dot25, 508, 1321); Dot dot26 = new Dot(); addObject(dot26, 446, 1610); Dot dot27 = new Dot(); addObject(dot27, 785, 1277); Fuel fuel = new Fuel(); addObject(fuel, 477, 255); Fuel fuel2 = new Fuel(); addObject(fuel2, 543, 14); Fuel fuel3 = new Fuel(); addObject(fuel3, 554, 389); Fuel fuel4 = new Fuel(); addObject(fuel4, 318, 327); Fuel fuel5 = new Fuel(); addObject(fuel5, 110, 423); Fuel fuel6 = new Fuel(); addObject(fuel6, 257, 513); Fuel fuel7 = new Fuel(); addObject(fuel7, 739, 607); Fuel fuel8 = new Fuel(); addObject(fuel8, 931, 269); Fuel fuel9 = new Fuel(); addObject(fuel9, 773, 48); Fuel fuel10 = new Fuel(); addObject(fuel10, 1189, 390); Fuel fuel11 = new Fuel(); addObject(fuel11, 1110, 554); Fuel fuel12 = new Fuel(); addObject(fuel12, 1389, 258); Fuel fuel13 = new Fuel(); addObject(fuel13, 1309, 62); Fuel fuel14 = new Fuel(); addObject(fuel14, 970, 684); Fuel fuel15 = new Fuel(); addObject(fuel15, 152, 701); Fuel fuel16 = new Fuel(); addObject(fuel16, 1334, 455); Fuel fuel17 = new Fuel(); addObject(fuel17, 1588, 298); Fuel fuel18 = new Fuel(); addObject(fuel18, 1514, 112); Fuel fuel19 = new Fuel(); addObject(fuel19, 1850, 526); Fuel fuel20 = new Fuel(); addObject(fuel20, 1755, 287); Fuel fuel21 = new Fuel(); addObject(fuel21, 1525, 576); Fuel fuel22 = new Fuel(); addObject(fuel22, 1219, 784); Fuel fuel23 = new Fuel(); addObject(fuel23, 1753, 685); Fuel fuel24 = new Fuel(); addObject(fuel24, 1863, 760); Fuel fuel25 = new Fuel(); addObject(fuel25, 546, 712); Fuel fuel26 = new Fuel(); addObject(fuel26, 87, 867); Fuel fuel27 = new Fuel(); addObject(fuel27, 412, 940); Fuel fuel28 = new Fuel(); addObject(fuel28, 749, 664); Fuel fuel29 = new Fuel(); addObject(fuel29, 1564, 811); Fuel fuel30 = new Fuel(); addObject(fuel30, 1212, 1035); Fuel fuel31 = new Fuel(); addObject(fuel31, 872, 846); Fuel fuel32 = new Fuel(); addObject(fuel32, 646, 859); Fuel fuel33 = new Fuel(); addObject(fuel33, 265, 866); Fuel fuel34 = new Fuel(); addObject(fuel34, 788, 989); Fuel fuel35 = new Fuel(); addObject(fuel35, 1488, 1102); Fuel fuel36 = new Fuel(); addObject(fuel36, 1502, 1369); Fuel fuel37 = new Fuel(); addObject(fuel37, 1250, 1282); Fuel fuel38 = new Fuel(); addObject(fuel38, 1002, 1101); Fuel fuel39 = new Fuel(); addObject(fuel39, 587, 1235); Fuel fuel40 = new Fuel(); addObject(fuel40, 354, 1139); Fuel fuel41 = new Fuel(); addObject(fuel41, 118, 1120); Fuel fuel42 = new Fuel(); addObject(fuel42, 1897, 956); Fuel fuel43 = new Fuel(); addObject(fuel43, 1814, 1218); Fuel fuel44 = new Fuel(); addObject(fuel44, 1703, 1193); Fuel fuel45 = new Fuel(); addObject(fuel45, 1557, 1178); Fuel fuel46 = new Fuel(); addObject(fuel46, 942, 1255); Fuel fuel47 = new Fuel(); addObject(fuel47, 1159, 1352); Fuel fuel48 = new Fuel(); addObject(fuel48, 896, 1433); Fuel fuel49 = new Fuel(); addObject(fuel49, 440, 1409); Fuel fuel50 = new Fuel(); addObject(fuel50, 219, 1246); Fuel fuel51 = new Fuel(); addObject(fuel51, 1510, 1645); Fuel fuel52 = new Fuel(); addObject(fuel52, 1052, 1645); Fuel fuel53 = new Fuel(); addObject(fuel53, 740, 1626); Fuel fuel54 = new Fuel(); addObject(fuel54, 551, 1560); Fuel fuel55 = new Fuel(); addObject(fuel55, 217, 1503); } } i think you can see now
danpost danpost

2021/12/18

#
sashvanth wrote...
i think you can see now
Is there nothing else in that class?
sashvanth sashvanth

2021/12/19

#
yes
danpost danpost

2021/12/19

#
sashvanth wrote...
yes
What is your Actor>Car class structure like? (what extends what?)
sashvanth sashvanth

2021/12/20

#
I don't understand
sashvanth sashvanth

2021/12/20

#
do you mean this this was what there in there like you said public class Track extends World
danpost danpost

2021/12/20

#
sashvanth wrote...
do you mean this this was what there in there like you said public class Track extends World
Right idea -- wrong class. My interest is with Car1, Car2 and Car3 classes.
sashvanth sashvanth

2021/12/21

#
car 3 main actor which consume fuel public class Car3 extends Animal car 2 side actor public class Car2 extends Animal car 3 side actor public class Car1 extends Animal fuel which car 3 need to consume public class Fuel extends Animal
You need to login to post a reply.
1
2