Devlog 1.0: Ren'Py Movement
Start Chapter 5 » Devlog
Devlog 1.0: Ren'Py Movement
So recently I wanted to add movement into my game. HERE YOU GO
Coding:
Initilization
Youll want to initilaze the variables beforehand, so copy the 1st section of code below. This just prevents any errors.
Screen Buttons
Next, you'll want to add key actions to detect keypresses. Copy the 2nd section of code. What this does, is checks if the image has crossed boundaries. If it hits a bound, it will not be responsive. If it is not on a bound, it will move the image in the direction specified. You may change the boundaries, but I use it specifically in my battle screen. You can also change the keys, to any you like.
Image Addence
Now, just add the image, as shown in the 3rd section of code. You can change the zoom, as long as the image is not bigger than the screen.
## Initilization ########################################################################################### default objxpos = 0.8 default objypos = 0.8 ## Screen Buttons ########################################################################################## key "w" action If(objypos <= 0.6, NullAction(), SetVariable("objypos", objypos - 0.05)) key "repeat_w" action If(objypos <= 0.6, NullAction(), SetVariable("objypos", objypos - 0.05)) key "a" action If(objxpos <= 0.4, NullAction(), SetVariable("objxpos", objxpos - 0.02)) key "repeat_a" action If(objxpos <= 0.4, NullAction(), SetVariable("objxpos", objxpos - 0.02)) key "s" action If(objypos >= 0.95, NullAction(), SetVariable("objypos", objypos + 0.05)) key "repeat_s" action If(objypos >= 0.95, NullAction(), SetVariable("objypos", objypos + 0.05)) key "d" action If(objxpos >= 0.95, NullAction(), SetVariable("objxpos", objxpos + 0.02)) key "repeat_d" action If(objxpos >= 0.95, NullAction(), SetVariable("objxpos", objxpos + 0.02)) ## Image Addence ########################################################################################### add "myim.png" xalign objxpos yalign objypos zoom 0.95
Start Chapter 5
Where is he?
Status | In development |
Author | DaWinnerIsHere |
Genre | Visual Novel, Adventure |
Tags | Anime, dawinnerishere, Horror, Psychological Horror, Ren'Py, Singleplayer, start-ch-5, xxfnafxserverxx |
Languages | English |
Accessibility | Subtitles |
More posts
- Log 0.1Apr 08, 2020
- Devlog 0.9: Ren'Py Project BackupsMar 20, 2020
- Devlog 0.8Mar 14, 2020
- I CALL CHALLENGEMar 02, 2020
- Devlog 0.7Dec 16, 2019
- Devlog 0.6Nov 25, 2019
- Features / Checklist 0.1Oct 14, 2019
- Devlog 0.4Oct 12, 2019
- Devlog 0.3Aug 02, 2019
Leave a comment
Log in with itch.io to leave a comment.