Some more beginner questions

tysm my eyes aren’t bleeding anymore

1 Like

@ALUCARD @lifeofpain what is this sorceryyyy???

like i upload an image ( example, smething i drew) then add that script and i can move it?

sort of. it has to be a sprite entity

1 Like

ok ok , i still havent gotten around on how to incorporate a sprite into my game. still learning from tutorial videos.

any other tips you might have?

No actually I think its a plane

1 Like

Well this is my entire project here. Let me know if there are any features you here you would like help with. Just dont go into my project and steal my code, thats lame.

Ravioli Burglar Simulator by 18 Aliens (itch.io)

That rpg test was just some random thing I made in this game to test, it took me maybe an hour maximum.

1 Like

me help?i just started last week lolz

i dont even know where to begin bro, you’re way more advanced

oh no stealing other peoples hard work is SUUUUPER LAME, i agree, and i would never do that bro, scouts honor!

cool cool thanks for the help

I meant if you needed help.

1 Like

oh ok ok gotcha hahaha

heloooo anyone know how to code a jumping mechanic with the rolling ball game?

yeah

whateverthescriptis.prototype.initialize = function() {
    this.app.keyboard.on(pc.EVENT_KEYDOWN,this.jump,this);
}

whateverthescriptis.prototype.jump = function(event) {
   if(event.key == pc.KEY_SPACE){
       this.entity.rigidbody.applyImpulse(0,1,0);
    };
}

3 Likes

yoooo!!! thanks buddy!

i just paste this on the movement script, right?

can i paste it anywhere or does it have to be in a specific place? sorry, super noob here

also does this apply physics/ gravity thingy? like if i press the space bar multiple times, it doesnt make the ball jump in the air?

it allows you to fly lol. you cant paste it but if you take the basic concepts in it you can apply them to the script.

1 Like

image

so i pasted it on the last part, didnt work.

changed the “whateverthisscriptis” to movement lolz im just doing this as i go hahaa

you are using two initialize functions which you shouldnt do. i got it incorrect and “keydown” should be replaced with pc.EVENT_KEYDOWN. hope this may help