and thanks @awc95014
hrmmm…
i wanna make the cute ghost character controlling the main character body when key ‘e’ clicked…
and if clicked key 'e ’ again the character goes out of him…
i tried to test it…and it almost work …cuz idk how to make after the ghost out from the main character the x position should be the same like position of the ghost …
…
ghost8-25-2021_21-54-24.wick (25.6 KB)
this what i did so far…
help…??
Using a funny thing called currentFrameNumber
or currentFrameName
, you can set the position of the character to the ghost as long as the object’s current frame number is greater than, lesser than, or equal to a certain number.
since you wanted this:
we just rewrite in the update script inside the character clip:
//if Ghost is playing a frame number that is greater than 3
if (Ghost.currentFrameNumber > 3){
this.x = Ghost.x; //set my position to Ghost
}
//otherwise dont do anything
The ghost clip is lacking a name, so you just give it whatever name it is if not Ghost.
… although do note that this is just one of the many solutions to this! You don’t even have to use the code up there, and just use a variable!
//inside the character clip
if (isGhost === true){// if whatever variable is true (from pressing e)
this.x = Ghost.x; //set my position to Ghost
}
Not that you can’t use my solution or anyone else’s, but there are definitely efficient and practical ones out there for more… peculiarly complex problems.
so I bid you good luck on whatever shenanigans you’re up to with your projects!
@KringlePrinkles man…>u< thanks so much you helped me a lot >u<…i think i might take more time to understand the code anyway…(i will tried my best)>u<
cool >u< I didnt think even think to search the wick doc in wick forum>u<…thanks…hmm…ok I’ll took my pencil and wrote that down(in the link)
what’s your primary language? just wondering
Oh ok I was just wondering
how to use variable…i…i never use it…
is it give value to the clip or…what??hmm
so to use a variable you just do this.
variablename = whathever
you could search up a tutorial too :).
like
player = 10
?
yes you could do something like
playerSpeed = 10
that’s what a variable is for it stores data to use in other parts of the code,
you welcome :)
Well if you are going to use variables, i recommend that you reference the objects when setting variables using (object name).(insert variable name)
.
why it wouldn’t work with just the var
(variable declaration) was because the variable is only accessible inside the script in the object.
Let’s say i want objectA
to have a variable called emotion
, I’ll just go into the clip’s script and type this.emotion //this refering to the object itself
.
if other objects have variables, you can change and set their variables directly.
we often use project.(variable name)
so that any object can access these variables.
You explained it better then I could :)
thanks @KringlePrinkles >u<
testing…8-26-2021_13-57-25.wick (1.7 KB)
i tried and it work >u<…man…you help me a lot …thanks guys
man…with all your guys help i finally solved this problem >u< yay… thanks so much
https://drive.google.com/file/d/1zsmr3VtcX5Znz1kkm_0rVKIU8cvCndLZ/view?usp=sharing
(i got problem uploading the file here…so i use drive)
nice game, can i help with coding?
sure… >u<
here are my latest progress
https://drive.google.com/file/d/1zmrCWElfj6mIplCgBHCPj6GIAYvzpuko/view?usp=sharing
ok here what my plan for the game
- level1 - it just a tutorial for users to know that they could change themselves into other player (player 1 to player 2)
ouh…player 1 can:
run
but he cant go through the wall
player 2 can
control player 1(actually player 2 just turn itself into player 1 so it make user think player 2 is controlling player 1 )
and he can go through the wall (except the ghost wall(the fade in and fade out wall animation))
2.and then the level 1 finish when they going into the portal
3.after that …go to level 2
and they saw reven who was trap…and player 2 go to reven and
the comic appeared on the screen (to tell user the situation)
but the evil ghost got the key and he ran away from them so they had to chase the evil ghost…T uT
man its to long…
who’s reven again. also whats the comic