From 13edb7d2b6aa0516c03ce4bf2b99e71d18a67506 Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 15 Sep 2026 09:25:25 +0200 Subject: [PATCH] initial --- SMIMS-Game/.idea/.gitignore | 10 +++++++ SMIMS-Game/.idea/misc.xml | 6 ++++ SMIMS-Game/.idea/modules.xml | 8 +++++ SMIMS-Game/.idea/vcs.xml | 6 ++++ SMIMS-Game/Ground.class | Bin 0 -> 305 bytes SMIMS-Game/Ground.ctxt | 7 +++++ SMIMS-Game/Ground.java | 19 ++++++++++++ SMIMS-Game/MyWorld.class | Bin 0 -> 476 bytes SMIMS-Game/MyWorld.ctxt | 10 +++++++ SMIMS-Game/MyWorld.java | 31 +++++++++++++++++++ SMIMS-Game/Player.class | Bin 0 -> 1101 bytes SMIMS-Game/Player.ctxt | 10 +++++++ SMIMS-Game/Player.java | 38 ++++++++++++++++++++++++ SMIMS-Game/README.TXT | 12 ++++++++ SMIMS-Game/SMIMS-Game.iml | 11 +++++++ SMIMS-Game/images/ppl2.png | Bin 0 -> 1955 bytes SMIMS-Game/images/weave.jpg | Bin 0 -> 2394 bytes SMIMS-Game/project.greenfoot | 56 +++++++++++++++++++++++++++++++++++ 18 files changed, 224 insertions(+) create mode 100644 SMIMS-Game/.idea/.gitignore create mode 100644 SMIMS-Game/.idea/misc.xml create mode 100644 SMIMS-Game/.idea/modules.xml create mode 100644 SMIMS-Game/.idea/vcs.xml create mode 100644 SMIMS-Game/Ground.class create mode 100644 SMIMS-Game/Ground.ctxt create mode 100644 SMIMS-Game/Ground.java create mode 100644 SMIMS-Game/MyWorld.class create mode 100644 SMIMS-Game/MyWorld.ctxt create mode 100644 SMIMS-Game/MyWorld.java create mode 100644 SMIMS-Game/Player.class create mode 100644 SMIMS-Game/Player.ctxt create mode 100644 SMIMS-Game/Player.java create mode 100644 SMIMS-Game/README.TXT create mode 100644 SMIMS-Game/SMIMS-Game.iml create mode 100644 SMIMS-Game/images/ppl2.png create mode 100644 SMIMS-Game/images/weave.jpg create mode 100644 SMIMS-Game/project.greenfoot diff --git a/SMIMS-Game/.idea/.gitignore b/SMIMS-Game/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/SMIMS-Game/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/SMIMS-Game/.idea/misc.xml b/SMIMS-Game/.idea/misc.xml new file mode 100644 index 0000000..6f29fee --- /dev/null +++ b/SMIMS-Game/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SMIMS-Game/.idea/modules.xml b/SMIMS-Game/.idea/modules.xml new file mode 100644 index 0000000..d9df081 --- /dev/null +++ b/SMIMS-Game/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/SMIMS-Game/.idea/vcs.xml b/SMIMS-Game/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/SMIMS-Game/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SMIMS-Game/Ground.class b/SMIMS-Game/Ground.class new file mode 100644 index 0000000000000000000000000000000000000000..220e0617da8b0012ed498c709b23c6eebc322a59 GIT binary patch literal 305 zcmZ9GO^U)m5QSgGXf*yry@5M*Ko6h@BIqW}W(N0dY_&zx(006+E5U^am_rRyZA1op z@rw6eeNFxR-tGXVXoc`l2;kRHM2Qe>jg;v|Ydf4KRvSWTtWsqsghIEs3{d7|VRV+R z3I0s4B{Q)~b%7 literal 0 HcmV?d00001 diff --git a/SMIMS-Game/Ground.ctxt b/SMIMS-Game/Ground.ctxt new file mode 100644 index 0000000..274ad51 --- /dev/null +++ b/SMIMS-Game/Ground.ctxt @@ -0,0 +1,7 @@ +#BlueJ class context +comment0.target=Ground +comment0.text=\r\n\ Write\ a\ description\ of\ class\ Ground\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n +comment1.params= +comment1.target=void\ act() +comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ Ground\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n +numComments=2 diff --git a/SMIMS-Game/Ground.java b/SMIMS-Game/Ground.java new file mode 100644 index 0000000..985c4c8 --- /dev/null +++ b/SMIMS-Game/Ground.java @@ -0,0 +1,19 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class Ground here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class Ground extends Actor +{ + /** + * Act - do whatever the Ground wants to do. This method is called whenever + * the 'Act' or 'Run' button gets pressed in the environment. + */ + public void act() + { + // Add your action code here. + } +} diff --git a/SMIMS-Game/MyWorld.class b/SMIMS-Game/MyWorld.class new file mode 100644 index 0000000000000000000000000000000000000000..c9c4726762e2d0bef0616b506268a4f8a3d935ea GIT binary patch literal 476 zcmZ9IZ%e{Z6vm%Bm(w->OwInO&^tA-4`4(V1i~tzuzGpjt~FUsZZq&(^i_JJP|yeH zLq+G#LC~ACdk*LMJPIK^ zX!iU4*3d)-Sp%kpO;`-ZU1LYl~-s0=J6E?Fp}!jR>j zcRiX2H)5zZoj>EA8-=o~ycqQJ&?92O@u%Wy{yY-$mX89Ol$_Az!H`Q|^~q3=p8OXg zJ4vW6MVQ4A7&6W}49(1&a4ubO;VY1p>~<#nmE(W{YIGS;Whyb%E$Yso(+eoJZT4ns z_xcK~y@c@|Z&s=1k)m3rt5i@R%{FyPO&aWAm%f_1Si&0+Px(|nk$YIt|FsWo*0I^? e683*)jWX4V+=!XgwJu?1h`5J+qB7KCkNPhM&QO2= literal 0 HcmV?d00001 diff --git a/SMIMS-Game/MyWorld.ctxt b/SMIMS-Game/MyWorld.ctxt new file mode 100644 index 0000000..25b6c20 --- /dev/null +++ b/SMIMS-Game/MyWorld.ctxt @@ -0,0 +1,10 @@ +#BlueJ class context +comment0.target=MyWorld +comment0.text=\r\n\ Write\ a\ description\ of\ class\ MyWorld\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n +comment1.params= +comment1.target=MyWorld() +comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ MyWorld.\r\n\ \r\n +comment2.params= +comment2.target=void\ prepare() +comment2.text=\r\n\ Prepare\ the\ world\ for\ the\ start\ of\ the\ program.\r\n\ That\ is\:\ create\ the\ initial\ objects\ and\ add\ them\ to\ the\ world.\r\n +numComments=3 diff --git a/SMIMS-Game/MyWorld.java b/SMIMS-Game/MyWorld.java new file mode 100644 index 0000000..b18d2c8 --- /dev/null +++ b/SMIMS-Game/MyWorld.java @@ -0,0 +1,31 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class MyWorld here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class MyWorld extends World +{ + + /** + * Constructor for objects of class MyWorld. + * + */ + public MyWorld() + { + // Create a new world with 600x400 cells with a cell size of 1x1 pixels. + super(400, 600, 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() + { + Player player = new Player(); + addObject(player,302,320); + } +} diff --git a/SMIMS-Game/Player.class b/SMIMS-Game/Player.class new file mode 100644 index 0000000000000000000000000000000000000000..53822cc5902166bc4c25a83757c43afe637e31e7 GIT binary patch literal 1101 zcmZ`&TT|0O6#lkJNt%XRX}QSN8@3UtQtw5if?~%a&fqY@i-fQ(!8Bpor3^pCU*L-` z&Pa89@X-hVla6Q80v$&mva@^kobUV2wX` zw;OiWv;9hTUDRB^lFw{OrZE%am|##VT)YW|7iD-Bu6r10_b zWWiFfOL}`tuFqc{R(E*qwY}p}Bq1C2Htd=!&+VWp_S`x(T57#3)ho6`blvO1cHXVp z2kksP@LN(tbGJzOUf2bhSM~xqHT@m-oN6)FgTtD`pShAh-lCY5Pe{+A(-1nWfe~`==!W`|+wddN@k0?(?WMr5~7x1_(qCqj)^&}yu zo0yrml+mcCZYORvkz1Yl0Zsh?Rrz>E*fMF12q%!DKR^;qwIJF=I!RazjZ48G*PoCh Vl01&cFN`w{kwxj;5``jI{sYtB$tM5+ literal 0 HcmV?d00001 diff --git a/SMIMS-Game/Player.ctxt b/SMIMS-Game/Player.ctxt new file mode 100644 index 0000000..c19adf5 --- /dev/null +++ b/SMIMS-Game/Player.ctxt @@ -0,0 +1,10 @@ +#BlueJ class context +comment0.target=Player +comment0.text=\r\n\ Write\ a\ description\ of\ class\ Player\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n +comment1.params= +comment1.target=void\ act() +comment2.params= +comment2.target=void\ player_movement() +comment3.params= +comment3.target=boolean\ onGround() +numComments=4 diff --git a/SMIMS-Game/Player.java b/SMIMS-Game/Player.java new file mode 100644 index 0000000..f3a9eaf --- /dev/null +++ b/SMIMS-Game/Player.java @@ -0,0 +1,38 @@ +import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) + +/** + * Write a description of class Player here. + * + * @author (your name) + * @version (a version number or a date) + */ +public class Player extends Actor +{ + int velocityY = 0; + int speed = 5; + public void act() + { + player_movement(); + } + + public void player_movement(){ + if (Greenfoot.isKeyDown("D")){ + setLocation(getX()+speed, getY()); + } + if (Greenfoot.isKeyDown("A")){ + setLocation(getX()-speed, getY()); + } + } + + public boolean onGround(){ + int height = getImage().getHeight(); + + Actor floor = getOneObjectAtOffset( + 0, + height / 2 + 1, + Ground.class + ); + + return floor != null; + } +} diff --git a/SMIMS-Game/README.TXT b/SMIMS-Game/README.TXT new file mode 100644 index 0000000..7342ea5 --- /dev/null +++ b/SMIMS-Game/README.TXT @@ -0,0 +1,12 @@ +------------------------------------------------------------------------ +This is the project README file. Here, you should describe your project. +Tell the reader (someone who does not know anything about this project) +all they need to know. The comments should usually include at least: +------------------------------------------------------------------------ + +PROJECT TITLE: +PURPOSE OF PROJECT: +VERSION or DATE: +HOW TO START THIS PROJECT: +AUTHORS: +USER INSTRUCTIONS: diff --git a/SMIMS-Game/SMIMS-Game.iml b/SMIMS-Game/SMIMS-Game.iml new file mode 100644 index 0000000..b107a2d --- /dev/null +++ b/SMIMS-Game/SMIMS-Game.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/SMIMS-Game/images/ppl2.png b/SMIMS-Game/images/ppl2.png new file mode 100644 index 0000000000000000000000000000000000000000..14f2b01df85a794813113355055a46f5810cbee2 GIT binary patch literal 1955 zcmV;U2VD4xP)MM*?KRCt`knR`rAXBday)6T3TAP!Zx8IB01tr(uAa2*4fsFsf$uuBbP*WaFtvKO`-c# zMr~9?*D0D#3R{ITK@dXvT^5^OrB$_9rdu93k2*!?ai^G6pCnQ(`DP;+PIpO7w}~T1 zzsX`7NLsoyWWkU&CRuvCR5b1}`WN-43PjTdoFhzeS=VS+Vd${X8yPhj?M#$0sD4n- zL_Jhf2PM#-!WJP*QCU@#>P*Se644`?eJDFHQSY$O(h0?6v1KMsOKkOsG7P&7!O1f0 zn1DoMm5~jlQ#spmx|3Pd-9iHgX&#<*VA zkJmrQZ_1ZstxeXRi>?NhU@jPjQB~1FO`Yeu+82;&nKxw}30Lo=FM< zhYO4&9ev2__?wz|%^lK1HcOt})nKbE$!@n3WPlWTbUk0%qVnpput^bQ}16u-2XCCGuOp56q4WI_x zMMIBevFSn$q2Cm3E)t857Kyr@y5N`BKv{&jpr%_8j`?3%jAl4)#{t7A!_C6F!glLh zRxxx}X#a_N(%cNhbcF9R^3fkWRhcSHZk9(gn=<=X(!+AjQ1~R-$ z7H@Q_5Y-*W5r?#tM(>S&cCsv^RLZgwiItMq;g|VHcAHRcnQLkD6e-#ra(WsER`$b4 zcHieIB|S^DidH?!R4UqFf7{+wQFX;@EaGO3f}(6?i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gc9xlsdoJ_jOc$Zoy5`er20N(HQdC-3lQ8b8tkIN;rYI_j%a)3;VWx5+*3{# zr23bf+x8ly8r6kW#z;IF_PBKMb{2T>{myJOxM78+(>5P72x>1CHX4tj25FBkm5fR; zK1pe$RE0+@SGmJ3T(x>K_z`-D^aVqcCD zYtJlgycpR2L3iz=b{mgx4Ra;C<gFLZAc+EM!zsQV}g?-K3iP0rVw8eC?!jS2EpEp%&B>&+^z~T#i6KcT1{c~rZ zX;`(F40%5{Y4pQ*GQp~lk6Z93F7x0aJ-v<5kJAoEtE^`c`eSC`R)r(fcy~XTua|r9 z79>Aj(R&@1uD9@0{%<(M3o1VXRk=p|VIz69ajq$R z_gp;!U8mb2nlmi7)I?F;;#_5QCrzjDxwPnhaI@Dra;$keskJID!SmyEAjnBf9h5bt zUZ@WaD+>40C~Pai+%wj_LyuAfQBz7EjewOHSUz>)!sO)d3)^|~CcvbRz2KNKCn4L( z)|RLCL(%rlxPyDzXkEUO5}a{Tou=x+>0$<(Lhun7K@49B-4ZKR z+Yj1@4evA9@bZ0dZ-r$a_s)8LNGbdlU;6{sUQ9-1CCf`Ibm*LxQZ^YS-O3wN~nccKnMaRN`kQp$kM zsd}E>P7Wy(G`lajuFQy{bd?yZ4-Nj&jE3pDxLN`t%_rxvlOg%-sv9cRh)!L(os9vy zWS=CW5*@0DixmM0@U@EG-=mvt%(~|sI;M7xXu+5tYrmQpU*<|o!|(+)V(Ou%AsZQ8b zkFI$K1dj_B)0t!WIbBxD$w-H7~ zc_zS}uW!R^@e#uVRUhTg=nRCY`EA>-0z)c+7OJFsBDy3C zYVb^DcHorWt!w1()@+)aj0MbOQQIi5CuywZM?mZX_ zv+f*r>BXixb~2p1UjnQdlBmLl*+mJu^!+~ofK~1I literal 0 HcmV?d00001 diff --git a/SMIMS-Game/project.greenfoot b/SMIMS-Game/project.greenfoot new file mode 100644 index 0000000..73e93c0 --- /dev/null +++ b/SMIMS-Game/project.greenfoot @@ -0,0 +1,56 @@ +#Greenfoot project file +class.Ground.image=weave.jpg +class.Player.image=ppl2.png +dependency1.from=MyWorld +dependency1.to=Player +dependency1.type=UsesDependency +dependency2.from=Player +dependency2.to=Ground +dependency2.type=UsesDependency +editor.fx.0.height=0 +editor.fx.0.width=0 +editor.fx.0.x=0 +editor.fx.0.y=0 +height=736 +package.numDependencies=2 +package.numTargets=3 +project.charset=UTF-8 +publish.hasSource=false +publish.locked=true +publish.longDesc= +publish.shortDesc= +publish.tags= +publish.title= +publish.url= +readme.height=60 +readme.name=@README +readme.width=49 +readme.x=10 +readme.y=10 +simulation.speed=50 +target1.height=70 +target1.name=Player +target1.showInterface=false +target1.type=ClassTarget +target1.width=120 +target1.x=0 +target1.y=0 +target2.height=70 +target2.name=Ground +target2.showInterface=false +target2.type=ClassTarget +target2.width=120 +target2.x=0 +target2.y=0 +target3.height=70 +target3.name=MyWorld +target3.showInterface=false +target3.type=ClassTarget +target3.width=120 +target3.x=0 +target3.y=0 +version=3.1.0 +width=856 +world.lastInstantiated=MyWorld +xPosition=652 +yPosition=76