My new adventure game

hrmm…can someone tell me how to make fight game…i want my character and the evil one to have 3 heart life …and when evil attack the character lose a life (sorry my bad english)…

i cant find in the forum… T u T

I don’t have the wick file for this (oops), but there’s this thing that I made…

I had a clip for the hearts with 4 frames: one with 3 hearts, one with 2, one with 1 (the 1-heart one flashes/blinks as a “warning” because why not), and one with nothing. Every time the player gets hit, it loses a life (the hearts clip goes to the next frame). The game will check if the hearts clip is on the 4th frame, which is when there are no hearts, and the game will end the game if so.

1 Like

oh no…(T u T)
i only a beginner of the coding thingy… …
does someone have toturial…

and thanks @awc95014

1 Like

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…??

1 Like

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:
image

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!

meanwhile I want you to bookmark More Wick Documents, which pumpkinhead wrote, since it could be useful in the future.

1 Like

@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)

1 Like

what’s your primary language? just wondering

Oh ok I was just wondering

1 Like

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 :).

1 Like

like

player = 10

?

1 Like

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,

1 Like

ok >u<…
thanks @Jordy

you welcome :)

1 Like

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.

2 Likes

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

2 Likes

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)

1 Like