Skip to content
Sign UpLog In
Profile icon

Dunce

@Dunce
Bio goes here.
  • New Pygame Project

    Cover page
    Made with Pygame
    Recent comments (0)
  • FUN GAME!!

    Cover page
    Made with Pygame
    Recent comments (27)
    CosmicBear
    CosmicBear
    2 years ago

    wow this is cool

    SamiOsman
    SamiOsman
    2 years ago

    @Dunce Here is my opinion: I think the background art and all of that are amazing! Here is a suggestion: You should make the tank able to move with arrow keys. Also, the zombies can spawn kill you. Try to make it so the zombies do not spawn until you move or something to slow them down before you can move. Please try to make a border so you can't move out. (Fullscreen please!) Besides that this a wonderfully amazing game!

    Best wishes [email protected]
    Dunce
    Dunce
    2 years ago

    @SamiOsman @JWZ6 Hello! Recently I've been working on this game a bit more, I'd like to get your opinion on it. Especially the new background art I made.

    SamiOsman
    SamiOsman
    2 years ago

    great

  • Search Engine (doesn't use Google API)

    Cover page
    Made with Node.js
    Recent comments (0)
  • Pygame Template 2.0

    Cover page
    Made with Pygame
    Recent comments (0)
  • Safe Exec

    Cover page
    Made with Python

    Safely execute dynamically generated code

    Recent comments (0)
Repls
Community
Dunce
Dunce
shared a Post
1 year ago
Can't iterate over return value of pygame.surfarray.array3d() with np.nditer()
when I run the following code: import numpy as np import pygame surface = pygame.Surface((300, 300)) array = pygame.surfarray.array3d(surface) for i
Dunce
Dunce
published a Repl
2 years ago
0
weekly-4
weekly-4weekly-4 challenge
OldWizard209
OldWizard209
Woah woah woah, thats smart2 years ago
DynamicSquid
DynamicSquid
SCORED Cool!2 years ago
Dunce
Dunce
shared a Post
2 years ago
Just give this repl the filepath to your code and it will leave many totally useful comments! By default it only works with Python code, but it's eas
Auto Commentor
Python
Dunce
Dunce
shared a Post
2 years ago
Hello, I'm working on making a search engine, I already made a web crawler which stores the URLs it finds in Repl DB. Now I'm wondering how I would e
ch1ck3n
ch1ck3n
var i;arr.forEach(function(item, index){if (item.contains(myString) i += 1)})2 years ago
Dunce
Dunce
shared a Post
2 years ago
Introduction Hello, this is a game I made a while back. I didn't finish it, but I thought it seemed a shame not to post it, because it's one of my bes
FUN GAME!!
Pygame
EdwardBentler
EdwardBentler
That's amazing! Nice job.2 years ago
InvisibleOne
InvisibleOne
Nice2 years ago
Chocolate16
Chocolate16
it so good i like it zombies go fest lol2 years ago
Dunce
Dunce
shared a Post
2 years ago
Introduction the HTML `title` attribute allows you to add tooltips to your elements, these are great for accessibility, or just making your webpage mo
Style Title Thingy
HTML, CSS, JS
Bookie0
Bookie0
Hmm I thought that attribute was called title? Tooltip would be something like this: 1_3gJ2VKho0yW4vEovAMtrjg Whereas this is title: Screen Shot 2021-06-10 at 11.04.25 AM2 years ago
Dunce
Dunce
shared a Post
2 years ago
This code: print(sorted([3, 3, 3, 2, 2, 2, 1, 1, 1,])) outputs: [1, 2, 3] But I would like it to keep the duplicate values, that is to say it should o
Coder100
Coder100
Use the sort method instead https://www.freecodecamp.org/news/the-python-sort-list-array-method-ascending-and-descending-explained-with-examples/2 years ago
Dunce
Dunce
shared a Post
2 years ago
I know you can download a file onto a user's device, like this: let file = new File(["Example"], "example.txt", { type: "text/plain" }) let url = UR
Coder100
Coder100
You can't download folders, but you can download zips.2 years ago
JBloves27
JBloves27
Hiya, not sure if this will help you, but here Hope this helps!2 years ago
Dunce
Dunce
shared a Post
2 years ago
So this code: myList = [[1, 2, 3], [1, 2, 3], [1, 2, 3]] newList = [item for item in list] is equivalent to: myList = [[1, 2, 3], [1, 2, 3], [1, 2, 3]
IMayBeMe
IMayBeMe
This is kind of cheap but it works: import itertools myList = [[1, 2, 3], [1, 2, 3], [1, 2, 3]] newList = list(itertools.chain.from_iterable(myList)) Slightly less cheap way: myList = [[1, 2, 3], [1, 2, 3], [1, 2, 3]] newList = [i for j in myList for i in j] 2 years ago
VulcanWM
VulcanWM
Wait what are you trying to do?2 years ago
Dunce
Dunce
shared a Post
2 years ago
Hello, how would I add server side code to a website? I already know a little bit of node.js. I just don't know how to actually add it to a website.
robowolf
robowolf
If you know python I would suggest using Flask. Here's a link to get you started.2 years ago
Dunce
Dunce
shared a Post
2 years ago
This repl uses the frequencies of the various letters' usage in everyday language to create a randomly generated word. Press enter to generate another
Random Word Generator
Python
Dunce
Dunce
shared a Post
2 years ago
When trying to make a canvas full screen you might think you could just write a CSS rule to resize it, like so: canvas { width: 100%; height: 100vh; }
RixTheTyrunt
RixTheTyrunt
You made a error! Look: height 100vh; while it needs to be like this: height: 100vh;1 year ago
Coder100
Coder100
pixel ratio is what you are looking for https://stackoverflow.com/questions/15661339/how-do-i-fix-blurry-text-in-my-html5-canvas you see, some computers have more pixels so you need to fix that2 years ago
Dunce
Dunce
shared a Post
2 years ago
Hello, this is a text editor I created. Your notes are saved in local storage, I think the rest is pretty self explanatory.
Text Editor
HTML, CSS, JS
ch1ck3n
ch1ck3n
image2 years ago
JWZ6
JWZ6
cool2 years ago
JWZ6
JWZ6
nice2 years ago
Dunce
Dunce
shared a Post
2 years ago
How would I position an element from a spot other than it's center in CSS? For example if I positioned an element something like this: img { position:
notGilbert
notGilbert
Do you have any transform applied to the image, that may be causing the pivot to be moved to the center. img { position: absolute; /* not recommended for most cases */ top: 50%; left: 50%; transform: unset; } `2 years ago
Dunce
Dunce
shared a Post
2 years ago
Hello I would like to take the string I get from a textarea, then look for certain words in that string, then apply a style to them. How would I do th
Coder100
Coder100
oh yeah btw if you are thinking of making a code editor... don't do this it'll cause more pain than anything, considering you could use something that replit uses, in half the time https://microsoft.github.io/monaco-editor/ unless ur making a Microsoft word, you should probably reconsider2 years ago
EdwardBentler
EdwardBentler
@Dunce If I understand you correctly, I think I have an answer, First, you'd have to get the string from the text area, so you would select the text area, document.querySelector('.textArea') Then you'd have to select the text inside, document.querySelector('.textArea').innerHTML That should give you a string with whatever is inside of the text area, you could save the string to a variable if you want, whatever you want to do you can. Next, there's a special function for finding certain words2 years ago
Dunce
Dunce
@ch1ck3n @Bookie0 Thanks, sorry I didn't check my notifications.2 years ago
Dunce
Dunce
shared a Post
2 years ago
I get the error: AttributeError: type object 'Image' has no attribute 'new' When I run the code: from PIL import Image image = Image.new("RGB", (100,
SixBeeps
SixBeeps
Instead of from PIL import Image try import PIL.Image then use image = PIL.Image.new("RGB", (100, 100)) `2 years ago
Dunce
Dunce
shared a Post
2 years ago
How would I make a one line while loop? I know you can do while True: print("Hello world!") but then if I put anything before it, like print("Start!")
Dunce
Dunce
shared a Post
2 years ago
So if I had a rotated sprite in pygame, and I wanted to move it in the direction it was facing, how would I do that? I don't want the movement to have
notGilbert
notGilbert
I'm not a pygame expert, but you can use trigonometry, and simple xy movement to move it in a direction. from math import sin, cos direction = 0 # in radians!!! speed = 20 def move(): player.x += cos(direction) * speed player.y += sin(direction) * speed you might need to tweak it a little (change the signs) since it will assume the player is facing horizontally 2 years ago
Dunce
Dunce
shared a Post
2 years ago
How would I create an optional positional argument in python? All the instructions I've been able to find are unclear.
RYANTADIPARTHI
RYANTADIPARTHI
wdym by optional position?2 years ago
InvisibleOne
InvisibleOne
something like this: def banana(name, color='yellow'): # color will default to yellow if not argument is given print("Nice " + name + " banana that is " + color) banana("joey") # will print out the color as yellow banana("bill", "green") # will print out the color as green `2 years ago
Dunce
Dunce
shared a Post
2 years ago
Hello, I just learned about meta tags in HTML, and I would like to specifie that I'm the author of a webpage, with a link to my Replit profile page. B
SixBeeps
SixBeeps
Meta tags do nothing but hold text. It does not hold any HTML data. You can put the link to your Replit account in there if you'd like, but the whole point of Meta information is to make it easier to find your webpage.2 years ago